Print a file from the Linux terminal with lp

Send PDFs, text files, and images straight to your printer without opening an app.

LinuxprintingLow risk
Run lp file.pdf to print to the default printer, or lp -d PrinterName file.pdf to pick one.

01Command

Command
$ lp -d HP-LaserJet report.pdf && lp -n 2 -o sides=two-sided-long-edge notes.txt

02What it does

lp submits the file to CUPS, the printing system behind most Linux desktops. lpstat -p lists printers and lpstat -d shows the default; -d overrides it for one job. Useful options: -n 3 for three copies, -o sides=two-sided-long-edge for duplex, -o media=A4 for paper size.

03Risk

RiskLow risk
RequirementsCUPS printing system with at least one configured printer (lpstat -p)
!Warning: lp sends the job immediately — there is no confirmation dialog. A wrong -d printer means your document may come out of a neighbour's printer; check lpstat -d first.

04Undo

Undo
$ cancel <job-id> (see lpstat -o for job ids)

05Sources

  • lp(1) — print files
    manpages.debian.org · community · 2026-09-17
    Evidence: lp submits files to CUPS; -d selects the printer, -n sets copies, and -o passes options such as duplex or media size.

Last verified: 2026-09-18 · Category: Files & Folders