lp
Print files
TLDR
Print the output of a command to the default printer (see lpstat command)
Print a file to the default printer
Print a file to a named printer (see lpstat command)
Print n copies of a file to the default printer
Print only certain pages to the default printer (print pages 1, 3-5, and 16)
Resume printing a job
SYNOPSIS
lp [options] [file...]
PARAMETERS
-d destination
Specifies the printer to use. If not specified, the default printer is used.
-n copies
Specifies the number of copies to print.
-o option
Specifies printer-specific options (e.g., paper size, print quality).
-t title
Sets the title for the print job.
-c
Force the scheduler to make a copy of the print file.
-m
Send mail after the job has been printed.
DESCRIPTION
The lp command submits files for printing. It allows users to print files to a specified printer or the default printer. It offers various options to control the print job, such as specifying the number of copies, paper size, and print quality. The lp command is a core part of the Common Unix Printing System (CUPS) on many Linux distributions. It interacts with the CUPS backend to manage print queues and communicate with printers. lp simplifies the process of printing documents and files from the command line, making it an essential tool for system administrators and users alike. The command handles various file formats and allows customization for specific printing needs. It also integrates with other printing utilities to provide a comprehensive printing solution.
CAVEATS
The available options may vary depending on the printer driver and CUPS configuration.
JOB ID
The lp command returns a job ID that can be used to track or cancel the print job using the cancel command.
DEFAULT PRINTER
The default printer can be configured system-wide or user-specific. Consult CUPS documentation for instructions on setting the default printer.
HISTORY
The lp command has evolved alongside Unix printing systems. Originally part of the System V printing system, it has been adopted by CUPS. The basic functionality of submitting print jobs has remained consistent, while the underlying mechanisms have been adapted to modern printing technologies.