Linux/Unix Command: lpr

The 'lpr' command transmits and manages print jobs

man using a copier

Stephan Zabel / E+ / Getty Images

The Linux command lpr submits files for printing. Files named in a shell session route to the named printer or to the system default destination if no destination is specified. If no files are listed, lpr reads the print file from the standard input. 

Synopsis

The command accepts the following general form:

lpr [ -E ] [ -P destination ] [ -# num-copies [ -l ] [ -o option ] [ -p] [ -r ] [ -C/J/T title ] [ file(s) ] 

Options

The following options are recognized by lpr:

  • -E: Forces encryption when connecting to the server.
  • -P destinationPrints files to the named printer.
  • -# copies: Sets the number of copies to print from 1 to 100.
  • -C name: Sets the job name.
  • -name: Sets the job name.
  • -T name: Sets the job name.
  • -l: Specifies that the print file is already formatted for the destination and should be sent without filtering. This option is equivalent to -oraw.
  • -o option: Sets a job option.
  • -p: Specifies that the print file should be formatted with a shaded header with the date, time, job name, and page number. This option is equivalent to -oprettyprint and is only useful when printing text files.
  • -r: Specifies that the named print files should be deleted after printing them.