Printing from the Linux Command Line


Printing from the Linux command line is easy. You use the lp command to request a print, and lpq to see what print jobs are in the queue, but things get a little more complicated when you want to print double-sided or use portrait mode. And there are lots of other things you might want to do — such as printing multiple copies of a document or canceling a print job. Let’s check out some options for getting your printouts to look just the way you want them to when you’re printing from the command line.

Displaying printer settings

To view your printer settings from the command line, use the lpoptions command. The output should look something like this:

$ lpoptions
copies=1 device-uri=dnssd://HP%20Color%20LaserJet%20CP2025dn%20(F47468)._pdl-datastream._tcp.local/ 
  finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=
  none,none marker-change-time=1553023232 marker-colors=#000000,#00FFFF,#FF00FF,#FFFF00 
  marker-levels=18,62,62,63 marker-names='Black Cartridge HP CC530A,Cyan Cartridge 
  HP CC531A,Magenta Cartridge HP CC533A,Yellow Cartridge HP CC532A' marker-types=
  toner,toner,toner,toner number-up=1 printer-commands=none printer-info='HP Color LaserJet 
  CP2025dn (F47468)' printer-is-accepting-jobs=true printer-is-shared=true printer-is-temporary=
  false printer-location printer-make-and-model='HP Color LaserJet cp2025dn pcl3, hpcups 3.18.7' 
  printer-state=3 printer-state-change-time=1553023232 printer-state-reasons=none printer-type=
  167964 printer-uri-supported=ipp://localhost/printers/Color-LaserJet-CP2025dn sides=one-sided   

This output is likely to be a little more human-friendly if you turn its blanks into carriage returns. Notice how many settings are listed.

Read more at Network World