Command Line Printing

lpr sends a file to the print spooler. For example,

lpr filename
					

This command will print the file with the name filename to the default printer. (Remember that the printer with the alias lp in /etc/printcap is considered to be the default printer. Users can, however, override the system default to configure a different printer to be their default. We will look at how to do this later on.)

If you want to print multiple files, you can specify more than one on the command line. For example,

lpr file1 file2 file3

If you want to print to a printer other than the one configured as the default, you can use the -P option followed by the name of the printer you want to print to, such as lpr -P simba file1. In this case, the file ...

Get Sams Teach Yourself FreeBSD® in 24 Hours 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.