cups
Common UNIX Printing System
TLDR
List available printers
$ lpstat -p
Print file to default printer$ lp [file.pdf]
Print to specific printer$ lp -d [printer-name] [file.pdf]
Print multiple copies$ lp -n [3] [file.pdf]
Check print queue$ lpq
Cancel print job$ cancel [job-id]
Add printer$ lpadmin -p [printer-name] -E -v [ipp://printer/ipp/print] -m everywhere
SYNOPSIS
lp [options] [file...]
lpr [options] [file...]
lpstat [options]
DESCRIPTION
CUPS (Common UNIX Printing System) manages printing on Linux. Uses IPP protocol for network printing. Provides lp, lpr, lpstat, and other commands. Web interface at http://localhost:631.
CONFIGURATION
/etc/cups/cupsd.conf
Main CUPS daemon configuration file controlling server behavior, access control, and logging./etc/cups/printers.conf
Printer definitions and settings (managed automatically by cupsd).~/.cups/lpoptions
User-specific default printer options and preferences.
PRINT COMMANDS
lp, lpr
Print fileslpstat
Show printer statuslpq
Show print queuelprm, cancel
Remove print jobslpadmin
Administer printerslpoptions
Set printer optionslpinfo
List drivers and devices
PRINT OPTIONS
-d printer
Destination printer-n copies
Number of copies-o media= size
Paper size (Letter, A4, etc.)-o sides= mode
two-sided-long-edge, two-sided-short-edge-o number-up= N
N pages per sheet (1,2,4,6,9,16)-o job-hold-until= time
Hold until time (indefinite, night, weekend)-o job-priority= N
Priority 1-100
WEB INTERFACE
Administration: http://localhost:631/admin
Requires user in lpadmin group.
CAVEATS
Use lpstat -p -d to see printers and default. Configure via web interface for easiest setup. cups-browsed auto-discovers network printers.
