天天看點

linux 終端列印_如何在Linux中從終端将純文字檔案列印到列印機

linux 終端列印

How to quickly print a plain text file to printers from a terminal in Linux?

如何在Linux中從終端将純文字檔案快速列印到列印機?

You can also use enscript:

您也可以使用腳本:

enscript – convert text files to PostScript, HTML, RTF, ANSI, and overstrikes

腳本–将文本檔案轉換為PostScript,HTML,RTF,ANSI和超标

https://www.systutorials.com/docs/linux/man/1-enscript/

https://www.systutorials.com/docs/linux/man/1-enscript/

enscript text-file
           

Answered by Eric Z Ma. 埃裡克·馬(Eric Z Ma)回答。

The

lp

command can print a plain text file to a printer.

lp

指令可以将純文字檔案列印到列印機。

My favorite command:

我最喜歡的指令:

cat text-file | lp -o media=a4 -o cpi=12 -o lpi=7.2 -o page-left=48 -o page-right=48 -o page-top=48 -o page-bottom=48
           

It is better to put the options into a script.

最好将選項放入腳本中。

翻譯自: https://www.systutorials.com/how-to-print-a-plain-text-file-to-printers-from-a-terminal-in-linux/

linux 終端列印