On Unix-like operating systems, the lp command prints files.

Description

lp submits files for printing, or alters a pending print job. Use a file name of “-” to specify printing from the standard input.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

Default Destination

lp uses the common printing system CUPS, providing many ways to set the default destination. The LPDEST and PRINTER environment variables are checked first. If neither are set, the current default set using the lpoptions command is used, followed by the default set using the lpadmin command.

Syntax

lp -i request-ID [-c] [-m] [-p] [-s] [-w] [-d destination] [-f form-name] [-H special-handling] [-n number] [-o options] [-p pagenumbers] [-q priority-level] [-S character-set | print-wheel] [-t title] [-T content-Type [-r]] [-y mode-list]

Options

Options

Aside from the printer-specific options reported by the lpoptions command, the following generic options are available:

Examples

lp -d myprinter -o media=legal -o sides=two-sided-long-edge file name

Prints the double-sided legal document file name to printer myprinter.

lp -d myprinter -o scaling=200 file name

Print document file name across 4 pages.

lp -d myprinter -o cpi=12 -o lpi=8 -o page-left=72 file name

Print a text file with 12 characters per inch, 8 lines per inch, and a 1 inch left margin.

cancel — Cancels a print job under the System V operating system.enable — Enable and disable LP printers.lpq — List the status of available printers.lpr — Submit print requests.lprm — Remove requests from the print queue.lpstat — List the status of the LP print services.mail — Read, compose, and manage mail.pr — Format a text file for printing.stty — Set options for your terminal display.