LinuxCommandLibrary

cups

Common UNIX Printing System

TLDR

List available printers

$ lpstat -p
copy
Print file to default printer
$ lp [file.pdf]
copy
Print to specific printer
$ lp -d [printer-name] [file.pdf]
copy
Print multiple copies
$ lp -n [3] [file.pdf]
copy
Check print queue
$ lpq
copy
Cancel print job
$ cancel [job-id]
copy
Add printer
$ lpadmin -p [printer-name] -E -v [ipp://printer/ipp/print] -m everywhere
copy

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/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.

SEE ALSO

lp(1), lpr(1), lpstat(1), lpadmin(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community