Basic Command-Line Printing

The lpr command is used to send a file to the print spooler. At its simplest, lpr takes the form:

# lpr filename

where filename is, naturally, the name of the file that should be printed. You can specify multiple filenames on the command line to cause multiple files to be printed.

You have the option of specifying a printer to which you want the data to be sent; to do so, use the -P option. If you omit the -P option, lpr assumes that the default printer should be used. The default printer is determined by checking these conditions in the following listed order; the first condition that is found to be true will be used to define the default printer:

  • If the PRINTER environment variable is set, lpr will use the name listed ...

Get FreeBSD6 Unleashed 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.