← 返回命令列表

Linux command

lp 命令

文件

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

常用示例

Print file

lp [file.pdf]

Print to specific printer

lp -d [printer_name] [file]

Print multiple copies

lp -n [3] [file]

Print double-sided

lp -o sides=two-sided-long-edge [file]

Print specific pages

lp -o page-ranges=[1-5] [file]

Print from stdin

cat [file] | lp

说明

lp prints files to a printer. It's the System V print command used with CUPS. The tool submits print jobs to the print queue. Options control copies, pages, and print quality.

参数

-d _PRINTER_
Destination printer.
-n _COPIES_
Number of copies.
-o _OPTION_
Printer option.
-P _PAGES_
Page list to print.
-q _PRIORITY_
Job priority (1-100).
--help
Display help information.

FAQ

What is the lp command used for?

lp prints files to a printer. It's the System V print command used with CUPS. The tool submits print jobs to the print queue. Options control copies, pages, and print quality.

How do I run a basic lp example?

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

What does -d _PRINTER_ do in lp?

Destination printer.