Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

lpr

Synopsis

lpr [options] [files]

Send files to be printed. If no files are given, accept standard input. We document the CUPS printing system here; the older LPRng and BSD systems will vary slightly. CUPS lpr, for example, does not accept the options c, d, f, g, i, m, n, t, v, or w, used by LPRng.

Options

-# copies

Set the number of copies to print, from 1 to 100.

-C, J, T name

Set a name for the print job.

-E

Use encryption when connecting to a print server.

-H server[:port]

Specify an alternate server and optional port.

-l

Expect a binary or literal file on which minimal processing should be done. The same as -o raw.

-m

Send email when printing is complete.

-o option[=value]

Set printer-specific options. These vary by printer, but may include paper type and orientation, paper-tray selection, output order, and so forth. Check the complete CUPS user manual and your printer’s PPD file for the full list.

-p

Pretty-print a text document. Provides a shaded header containing page numbers, the job name, and the time and date of printing. Equivalent to -o prettyprint.

-P printername

Print to the specified printer. If no printer is given, prints to the default printer, usually set with lpadmin.

-q

Hold job for printing.

-r

Delete files after printing them.

-U username

Specify an alternate username.

Example

Print a simple file:

Lpr filename.txt
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page