LPR(1) — UNIX Programmer’s Manual
NAME
lpr, print, opr − off line print
SYNOPSIS
lpr [−Pprinter] [−#] [−i#] [−C class] [−J job] [−crmpH] [name ...]
DESCRIPTION
lpr causes the named files to be printed on the line printer. If no names appear, the standard input is assumed.
lpr, print, and opr are the same program; the plethora of names is related to its origin.
lpr uses a spooling daemon that does the job when facilities become available. The single letter options have the following meaning:
-rRemove the file upon completion of spooling.
-mSend mail upon completion.
-pPrint the files using pr(1). Page headers and page numbers will be supplied by pr(1).
-HSuppress the printing of the burst page.
-iPrint the named files with the indentation specified. This option is valid only when the lp(5) device supports the required ioctl(2) call.
The flag −C takes the following argument as a classification for use on the burst page. For example,
lpr -C "Lincoln Labs" foo.c
would cause the system name to be replaced on the burst page by Lincoln Labs, and the file foo.c to be printed.
To get multiple copies of output, use the −# flag, where # is the number of copies desired of each file named. For example,
lpr -3 foo.c bar.c more.c
would result in 3 copies of the file foo.c, followed by 3 copies of the file bar.c, etc. On the other hand,
cat foo.c bar.c more.c | lpr -3
will give three copies of the concatenation of the files.
The line printer spooler will try to link(2) the named files into the spooling area whenever possible. This will happen if you are on the same file system and the file is publicly readable. Otherwise, the file will be copied into the spooling area before printing by the daemon.
The −P option may be used to force output to a specific printer. Normally, the default printer is used (site dependent), or the value of the environment variable PRINTER is used.
FILES
/etc/passwd personal identification
/etc/printcap printer capabilities data base
/usr/lib/lpd* line printer daemons
/usr/spool/* directories used for spooling
/usr/spool/*/df* daemon control files
/usr/spool/*/cf* copied files specified in "df" files
/usr/spool/*/lf* linked files specified in "df" files
/usr/spool/*/tf* temproary copies of "df" files
SEE ALSO
DIAGNOSTICS
If you try to spool too large a file, it will be truncated. lpr will object to printing binary files. Diagnostics may be printed in the daemon’s log file regarding missing spool files by lpd(5).
BUGS
lpr may be fooled into thinking a file is inaccessible when a user’s effective group id allows access, but the real group id does not.
7th Edition