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 files
lpstat
Show printer status
lpq
Show print queue
lprm, cancel
Remove print jobs
lpadmin
Administer printers
lpoptions
Set printer options
lpinfo
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/adminRequires user in lpadmin group.

INSTALL

sudo dnf install cups
sudo pacman -S cups
sudo zypper install cups
brew install cups
nix profile install nixpkgs#cups

CAVEATS

Use lpstat -p -d to see printers and default. Configure via web interface for easiest setup. cups-browsed auto-discovers network printers.

SEE ALSO

lp(1), lpr(1), lpstat(1), lpq(1), lprm(1), lpadmin(8), lpoptions(1), cupsctl(8)