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
lpcommand followed by the name of the file you want to print.lp fileName.pdf -
The
lpqcommand displays the print queue. - With the -n option, the
lpcommand 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
cancelorlprmcommand. - 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
lpsettings by using thelpoptionscommand to change the setting forsides.lpoptions -o sides=two-sided-short-edge