to print the file filename.pdf
using the default printer:
lpr filename.pdf
you can also specify the printer name using -P printername
:
lpr -P printername filename.pdf
in order to know the name of all the available printers:
lpstat -p
lpr
also has multiple options that can be explored using:
man lpr
Two of the most common options are:
-o sides=two-sided-long-edge
-o sides=two-sided-short-edge
and can be used as follows.
lpr -o sides=two-sided-long-edge filename.pdf
in order to print all the *.pdf
file in the current directory, use a bash loop:
for PDF in *.pdf; do echo "printing $PDF"; lpr -o sides=two-sided-long-edge $PDF; done