UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: lorderChapter 2
UNIX Commands
Next: Reference: lpq
 

lp

lp [options] [files]

Send files to the printer. To send standard input, specify - as one of the files.

Options

-c

Copy files to print spooler; if changes are made to file while it is still queued for printing, the printout is unaffected.

-d dest

Send output to destination printer named dest.

-d any

Used after -f or -S to print the request on any printer that supports the given name.

-f name

Print request on preprinted form name. name references printer attributes set by the administrative command lpforms.

-H action

Print according to the named action: hold (notify before printing), resume (resume a held request), immediate (print next; privileged users only).

-i IDs

Override lp options used for request IDs currently in the queue; specify new lp options after -i. For example, change the number of copies sent.

-m

Send mail after files are printed.

-n number

Specify the number of copies to print.

-o options

Set one or more printer-specific options. Standard options include:

nobanner

Omit banner page (separator) from request.

nofilebreak

Suppress formfeeds between files.

cpi=n

Print n characters per inch. n can also be pica, elite, or compressed.

lpi=n

Print n lines per inch.

length=n

Print pages n units long; e.g., 11i (inches), 66 (lines).

width=n

Print pages n units wide; e.g., 8.5i (inches) 72 (columns).

stty=list

Specify a quoted list of stty options.

-P list

Print only the page numbers specified in list.

-q n

Print request with priority level n (39 = lowest).

-r

Don't adapt request if content isn't suitable; reject instead. (Obscure; used only with -T.)

-s

Suppress messages.

-S name

Use the named print wheel or character set for printing.

-t title

Use title on the printout's banner page.

-T content

Send request to a printer that supports content (default is simple; an administrator sets content via lpadmin -I).

-w

Write a terminal message after files are printed (same as -m if user isn't logged on). Confirm the printing with a message on the user's terminal.

-y mode

Print according to locally-defined modes.

Examples

Send mail after printing five copies of report:

lp -n 5 -m report

Format and print thesis; print title too:

nroff -ms thesis | lp - title


Previous: Reference: lorderUNIX in a Nutshell: System V EditionNext: Reference: lpq
Reference: lorderBook IndexReference: lpq

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System