Cups - Command Line Printing - Cheat Sheet
Written by Wim Stockman - on 04 jun 2020 Updated - on 17 dec 2022
Cheat Sheet
- List available printers:
lpstat -p
- View default printer:
lpstat -d
- You can combine the commands:
lpstat -p -d
- Show pending print jobs
lpstat -W not-completed
- Show all status information
lpstat -t
- Setting the default printer:
lpoptions -d PRINTERNAME
This overwrites the ~/.cups/lpoptions file be carefull if you had some options in
- View the options available for your printer:
lpoptions -p PRINTERNAME -l
- to print with a specific options:
lp -p PRINTERNAME -o Media=A4 -o fit-to-page -o Quality=Draft
CREATING SAVED OPTIONS
So you can acces them later with an instance of your printer and don't have to retype everything.
lpoptions -p PRINTERNAME/INSTANCE1 -o Media=A4 -o fit-to-page -o Quality=Draft
then you can print with these options by specifying the instance
lp -p PRINTERNAME/INSTANCE1 file-to-print.ps
SETTING DEFAULT OPTIONS
Just setting the default options of your printer throught the command line.
lpadmin -p PRINERNAME -o OPTION=VALUE
e.g sudo lpadmin -p STAR -o PrintSpeed=1Middle
CANCEL JOBS
- Cancel the current job:
cancel
- Cancel all jobs
cancel -a