Printers
Before Configuring the Default Printer in Linux check with lpstat command
lpstat -t
Set Default Printer Linux Terminal
lpoptions -d <Printer Name>
We can also setup an default printer using simple environment variable adding into user profile file called ~/.bashrc
export PRINTER=printer-name
Displaying printer settings¶
lpoptions | tr " " '\n'
With the -v option, the lpinfo command will list drivers and related information.
lpinfo -v
The lpoptions
command will show the settings of the default printer. Use the -p
option to specify one of a number of available printers.
lpoptions -p <Printer Name>
Useful commands¶
-
To print a document on the default printer, just use the
lp
command followed by the name of the file you want to print.lp fileName.pdf
-
The
lpq
command displays the print queue. - With the -n option, the
lp
command allows to specify the number of copies of a printout we want.lp -n 11 fileName
- To cancel a print job, we can use the
cancel
orlprm
command. - To print in two-sided mode, use
lp -o sides=two-sided-long-edge fileName.pdf
- If we want all of our documents to print in two-side mode, we can change our
lp
settings by using thelpoptions
command to change the setting forsides
.lpoptions -o sides=two-sided-short-edge