← 返回命令列表

Linux command

enscript 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Print file to default printer

enscript [file]

Generate PostScript output

enscript -o [output.ps] [file]

Print two columns

enscript -2 [file]

Print with syntax highlighting

enscript -E [file.c]

Print landscape

enscript -r [file]

Print with header

enscript -b "[Header Text]" [file]

Print line numbers

enscript -C [file]

说明

enscript converts text files to PostScript, HTML, or RTF for printing or viewing. It provides advanced formatting capabilities including multi-column output, headers, footers, and syntax highlighting for numerous programming languages. The tool is widely used for generating professional-looking printouts of source code and documentation. It can automatically detect file types and apply appropriate syntax highlighting, making code more readable when printed. enscript supports customization through configuration files and command-line options, allowing control over fonts, page layout, borders, and output format. It's particularly useful in development environments for code reviews and documentation.

参数

-o _file_
Output to file instead of printer.
-E _lang_
Syntax highlighting.
-2
Two-column output.
-r
Landscape orientation.
-b _header_
Page header.
-C
Print line numbers.
-f _font_
Body font.
-F _font_
Header font.
-p _printer_
Select printer.
--color
Color output.

FAQ

What is the enscript command used for?

enscript converts text files to PostScript, HTML, or RTF for printing or viewing. It provides advanced formatting capabilities including multi-column output, headers, footers, and syntax highlighting for numerous programming languages. The tool is widely used for generating professional-looking printouts of source code and documentation. It can automatically detect file types and apply appropriate syntax highlighting, making code more readable when printed. enscript supports customization through configuration files and command-line options, allowing control over fonts, page layout, borders, and output format. It's particularly useful in development environments for code reviews and documentation.

How do I run a basic enscript example?

Run `enscript [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _file_ do in enscript?

Output to file instead of printer.