- The 30+ best Black Friday Apple deals 2024: Early sales available now
- Pro-Russian Hacktivists Launch Branded Ransomware Operations
- I tested a fancy nugget ice maker, and it's totally worth it - plus it's $150 off for Black Friday
- The most durable power station I've tested dares Mother Nature to do her worst - and it's on sale
- La Junta de Andalucía potencia el desarrollo de proyectos de digitalización mediante metodologías ágiles
How to print from the Linux command line: double-sided, landscape and more
$ lpoptions | tr " " 'n' | more copies=1 device-uri=socket://192.168.0.15 finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1717856401 marker-colors=#000000,#00FFFF,#FF00FF,#FFFF00 marker-levels=5,28,68,27 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 print-color-mode=color printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='HP
If you have multiple printers available, you can use the -p option to specify a particular printer.
$ lpoptions -p LaserJet
With the -v option, the lpinfo command will list drivers and related information, including the printer’s IP address.
$ lpinfo -v file cups-brf:/ network beh direct hp network ipps network lpd network socket network http network ipp network https network smb direct hpfax network socket://192.168.0.15 network dnssd://HP%20Color%20LaserJet%20CP2025dn%20(F47468)._pdl-datastream._tcp.local/
Now that we’ve taken a look at all the details you can view about your printers, let’s dive into printing.
Using the lp command
To print a document on the default printer, just use the lp command followed by the name of the file that you want to print. If the filename includes blanks (rare on Linux systems), either put the name in quotes or start entering the file name and press the tab key to invoke file completion (as shown in the second example below).
$ lp mystory $ lp the whole story request id is HP-Color-LaserJet-CP2025dn-2 (1 file(s))
Use the lpq command to view the files in the printer queue. Note, however, that some files will print so quickly that they’ll be done before you hit the enter key after typing “lpq” and you won’t get a listing. In this case, I put the lpq command on the same line to avoid the print finishing too quickly.
$ lp the whole story ; lpq request id is HP-Color-LaserJet-CP2025dn-3 (1 file(s)) HP-Color-LaserJet-CP2025dn is ready and printing Rank Owner Job File(s) Total Size active shs 3 the whole story 1024 bytes
Printing multiple copies of a file
With the -n option, the lp command allows you to specify the number of copies of a printout you want.