LPR(1) — USER COMMANDS
NAME
lpr − off line print
SYNOPSIS
lpr [ −Pprinter ] [ −#num ] [ −Cclass ] [ −Jjob ] [ −Ttitle ] [ −i[ num] ] [ −1234font ] [−wnum ]
[ −pltndgvcfrmhs ] [ filename ... ]
DESCRIPTION
Lpr uses a spooling daemon to print the named files when facilities become available. If no names appear, the standard input is assumed.
OPTIONS
−P Force output to the named printer. Normally, the default printer is used (site dependent), or the value of the environment variable PRINTER is used.
−# Produce multiple copies of output, using num as the number of copies for each file named. For example,
% lpr −#3 foo.c bar.c more.c
produces three copies of the file foo.c, followed by three copies of bar.c, etc. On the other hand,
% cat foo.c bar.c more.c | lpr −#3
generates three copies of the concatenation of the files.
−C Print class as the job classification on the burst page. For example,
% lpr −C EECS foo.c
replaces the system name (the name returned by hostname(1)) with EECS on the burst page, and prints the file foo.c.
−J Print job as the job name on the burst page. Normally, lpr uses the first file’s name.
−T Use title instead of the file name for the title used by pr(1).
−i Indent output num spaces. If num is not given, eight spaces are used as default.
−1234
Mount the specified font on font position i. The daemon will construct a .railmag file referencing /usr/lib/vfont/name.size.
−w Use num as the page width for pr.
The following single letter options are used to 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(1) to format the files (equivalent to print).
−l Print control characters and suppress page breaks.
−t The files contain data from troff(1) (cat phototypesetter commands).
−n The files contain data from ditroff (device independent troff).
−d The files contain data from tex(l) (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 for devices like the Benson Varian.
−c The files contain data produced by cifplot(l).
−f Interpret the first character of each line as a standard FORTRAN carriage control character.
The remaining single letter options are:
−r Remove the file upon completion of spooling.
−m Send mail upon completion.
−h Suppress the printing of the burst page.
−s Use symlink(2) to link data files rather than trying to copy them (so large files can be printed). This means the files should not be modified or removed until they have been printed.
FILES
/etc/passwdpersonal identification
/etc/printcapprinter capabilities data base
/usr/lib/lpd∗line printer daemons
/usr/spool/∗directories used for spooling
/usr/spool/∗/cf∗daemon control files
/usr/spool/∗/df∗data files specified in “cf” files
/usr/spool/∗/tf∗temporary copies of “cf” files
SEE ALSO
lpq(1), lprm(1), pr(1), symlink(2), printcap(5), lpc(8), lpd(8)
DIAGNOSTICS
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). Use
% ps ax | fgrep lpd
to get a list of process identifiers of running lpd’s. The lpd to kill is the one which is not listed in any of the “lock" files (the lock file is contained in the spool directory of each printer). Kill the master daemon using the following command.
% kill pid
Then remove /dev/printer and restart the daemon (and printer) with the following commands.
% rm /dev/printer % /usr/lib/lpd
Another possibility is that the lpr program is not setuid root, setgid spooling. This can be checked with
% ls −lg /usr/ucb/lpr
lpr: printer: printer queue is disabled
This means the queue was turned off with
% 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.
Sun Release 1.1 — Last change: 1 November 1983