Name

lpr — stdin  stdout  - file  -- opt  --help  --version

Synopsis

lpr [options] [files]

The lpr (line printer) command sends a file to a printer. To print on your default printer (or if you have just a single printer set up), run:

lpr myfile.txt

If your Mac is set up with multiple printers, then to print on a different printer than the default, supply the name of the printer with the -P option:

lpr -P myprinter myfile.txt

The names of your printers can be listed with the lpstat command:

lpstat -p
printer HP_Color_LaserJet_2605dn is idle.
enabled since Tue Apr 24 21:00:42 2012

Now to print on this printer, run:

lpr -P HP_Color_LaserJet_2605dn myfile

Useful options

-P printername

Send the file to printer printername, which you have set up previously.

-# N

Print N copies of the file.

-J name

Set the job name that prints on the cover page (if your system is set up to print cover pages).

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.