Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

lpq(1)

lprm(1)

pr(1V)

printcap(5)

lpc(8)

lpd(8)

rasterfile(5)

screendump(1)

LPR(1)  —  USER COMMANDS

NAME

lpr − off-line print

SYNOPSIS

lpr [ −Pprinter ] [ −#num ] [ −Cclass ] [ −Jjob ] [ −Ttitle ] [ −i[ num] ] [ −1234font ]

[−wnum ] [ −r ] [ −m ] [ −h ] [ −s ] [ −filter-option ] [ filename ... ]

DESCRIPTION

lpr uses a spooling daemon to print the named files when facilities become available.  lpr reads the stndard input if no files are specified. 

OPTIONS

−Pprinter
Force output to the named printer.  Normally, the default printer is used (site dependent), or the value of the PRINTER environment variable is used. 

−#num
Produce multiple copies of output, using num as the number of copies for each file named.  For example,

tutorial% lpr −#3 new.index.c print.index.c more.c

produces three copies of the file new.index.c, followed by three copies of print.index.c, etc.  On the other hand,

tutorial% cat new.index.c print.index.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,

tutorial% 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.

−i[num]
Indent output num spaces.  If num is not given, eight spaces are used as default. 

−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. 

−wnum
Use num as the page width for pr.

−r
Remove the file upon completion of spooling.

−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.  In the absence of this option, files larger than 1 Megabyte in length are truncated.  Note that the −s option only works on the local host (files sent to remote printer hosts are copied anyway), and only with named data files — it doesn’t work if lpr is at the end of a pipeline. 

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 (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). 

−c This option currently is unassigned. 

−f Interpret the first character of each line as a standard FORTRAN carriage control character. 

If no filter-option is given, ‘%!’ as the first two characters indicates that the file contains Postscript commands. 

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(1V), printcap(5), lpc(8), lpd(8), rasterfile(5), screendump(1)

DIAGNOSTICS

lpr: copy file is too large
A file is determined to be too ‘large’ to print by copying into the spool area. Use the −s option as defined above to make a symbolic link to the file instead of copying it.  A ‘large’ file is approximately 1 Megabyte in this system. 

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

tutorial% /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 the −f and −s flags are combined as follows:

lpr −fs filename

copies the file to the spooling directory rather than making a symbolic link. 

Placing the −s flag first, or writing each as separate arguments makes a link as expected. 

BUGS

lpr −p is not equivalent to pr | lpr.  lpr −p puts the current date at the top of each page, rather than the date last modified, and inserts a header page between each file printed. 

The −p and −# options don’t work well together; the second and subsequent copies do not include the file name in each page’s title. 

Fonts for troff and tex reside on the host with the printer.  It is currently not possible to use local font libraries. 

Sun Release 3.2  —  Last change: 30 July 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026