To print files, type
lpr filename...
This prints each of the listed files to the default printer.
If you list no files,
lpr reads data to print from
standard input. For example, this command prints some
important system files:
lpr /etc/host.conf /etc/hosts.equiv
To select a specific printer, type
lpr -P printer-name filename...
This example prints a long listing of the current directory
to the printer named rattan
:
ls -l | lpr -P rattan
Because no files were listed for the
lpr command,
lpr
read the data to print from standard input, which
was the output of the ls -l
command.
The lpr command can also accept a wide variety of options to control formatting, apply file conversions, generate multiple copies, and so forth. For more information, see the section Printing Options.