Table of Contents
lpr - send a job to the printer
lpr [ -Pprinter ] [ -#copies ] [ -Cclass ] [ -Jjob ]
[ -Ttitle ] [ -i [ indent ] ] [ -1234font ] [ -wcols ]
[ -r ] [ -m ] [ -h ] [ -s ] [ -filter-option ]
[ filename ... ]
lpr creates a printer job in a spooling area for subsequent
printing as facilities become available. Each printer job
consists of a control file and one or more data files. The
data files are copies of (or, with -s , symbolic links to)
each filename you specify. The spool area is managed by the
line printer daemon, lpd(8). Jobs that specify a printer on
a remote machine are forwarded by lpd.
lpr reads from the standard input if no files are specified.
- -Pprinter
- Send output to the named printer. Otherwise
send output to the printer named in the
PRINTER environment variable, or to the
default printer, lp.
- -#copies
- Produce the number of copies indicated for
each named file. For example:
example% lpr -#3 index.c lookup.c
produces three copies of index.c, followed by
three copies of lookup.c. On the other hand,
example% cat index.c lookup.c | lpr -#3
generates three copies of the concatenation
of the files.
- -Cclass
- Print class as the job classification on the
burst page. For example,
example% lpr -C Operations new.index.c
replaces the system name (the name returned
by hostname) with "Operations" on the burst
page, and prints the file new.index.c.
- -Jjob
- Print job as the job name on the burst page.
Normally, lpr uses the first file's name.
- -Ttitle
- Use title instead of the file name for the
title used by pr(1V).
- -i[ indent ]
- Indent output indent SPACE characters. Eight
SPACE characters is the default. The indent
is passed to the input filter. If no input
filter is present, this option is ignored.
-1 font
-2 font
-3 font
- -4 font
- Mount the specified font on font position 1,
2, 3 or 4. The daemon will construct a
.railmag file in the spool directory that
indicates the mount by referencing
/usr/lib/vfont/font.
- -wcols
- Use cols as the page width for pr.
- -r
- Remove the file upon completion of spooling,
or upon completion of printing with the -s
option.
- -m
- Send mail upon completion.
- -h
- Suppress printing the burst page.
- -s
- Create a symbolic link from the spool area to
the data files rather than trying to copy
them (so large files can be printed). This
means the data files should not be modified
or removed until they have been printed.
This option can be used to avoid truncating
files larger than the maximum given in the mx
capability of the printcap(5) entry. -s only
prevents copies of local files from being
made. Jobs from remote hosts are copied anyway.
-s only works with named data files; if
the lpr command is at the end of a pipeline,
the data is copied to the spool.
filter-option The following single letter options notify
the line printer spooler that the files are
not standard text files. The spooling daemon
will use the appropriate filters to print the
data accordingly.
- -p
- Use pr to format the files (lpr -p is
very much like `pr | lpr').
-l Print control characters and suppress
page breaks.
-t The files contain troff(1) (cat phototypesetter)
binary data.
-n The files contain data from ditroff
(device independent troff).
-d The files contain data from tex (DVI
format from Stanford).
-g The files contain standard plot data as
produced by the plot(3X) routines (see
also plot(1G) for the filters used by
the printer spooler).
-v The files contain a raster image, see
rasterfile(5). The printer must support
an appropriate imaging model such as
PostScript in order to print the image.
-c The files contain data produced by cifplot.
-f Interpret the first character of each
line as a standard FORTRAN carriage control
character.
If no filter-option is given (and the printer
can interpret PostScript), the string `%!' as
the first two characters of a file indicates
that it contains PostScript commands.
These filter options offer a standard user
interface, and all options may not be available
for, nor applicable to, all printers.
- /etc/passwd
- personal identification
- /etc/printcap
- printer capabilities data base
- /usr/lib/lpd
- line printer daemon
- /var/spool/l*
- directories used for spooling
- /var/spool/l*/cf*
- daemon control files
- /var/spool/l*/df*
- data files specified in `cf' files
- /var/spool/l*/tf*
- temporary copies of `cf' files
/usr/lib/vfont/font
lpq(1), lprm(1), plot(1G), pr(1V), screendump(1), troff(1),
plot(3X), printcap(5), rasterfile(5), lpc(8), lpd(8)
lpr: copy file is too large
A file is determined to be too "large" to print by
copying into the spool area. lpr truncates the file,
and prints as much of it as it can. The maximum file
length is specified by the mx capability of the
printcap(5) entry for the printer. If no mx capability
is specified, the default limit is 1000 Kbytes. Use
the -s option as defined above to make a symbolic link
to the file instead of copying it.
lpr: printer: unknown printer
The printer was not found in the printcap database.
Usually this is a typing mistake; however, it may indicate
a missing or incorrect entry in the /etc/printcap
file.
lpr: printer: jobs queued, but cannot start daemon.
The connection to lpd on the local machine failed.
This usually means the printer server started at boot
time has died or is hung. Check the local socket
/dev/printer to be sure it still exists (if it does not
exist, there is no lpd process running).
lpr: printer: printer queue is disabled
This means the queue was turned off with
example% /usr/etc/lpc disable printer
to prevent lpr from putting files in the queue. This
is normally done by the system manager when a printer
is going to be down for a long time. The printer can
be turned back on by a super-user with lpc.
If a connection to lpd on the local machine cannot be
made lpr will say that the daemon cannot be started.
Diagnostics may be printed in the daemon log file
regarding missing spool files by lpd.
Command-line options cannot be combined into a single argument
as with some other commands. The command:
lpr -fs
is not equivalent to
lpr -f -s
Placing the -s flag first, or writing each option as a
separate argument, makes a link as expected.
lpr -p is not precisely equivalent to pr | lpr. lpr -p puts
the current date at the top of each page, rather than the
date last modified.
Fonts for troff(1) and T X(R) reside on the printer host.
It is currently not possEible to use local font libraries.
lpr refuses to print a.out files and library archives.
The -s option only avoids copying the data file to the spool
directory of the local machine. If the printer for a job
resides on a remote machine, the data file will be copied to
the remote spool directory in all cases.
Table of Contents