lpr(1) — Commands
NAME
lpr − Sends files to spooling daemon for printing
SYNOPSIS
lpr [options] filename
FLAGS
The lpr flags −c, −d, −f, −g, −l, −n, −p, −t, and −v are used to notify the line printer spooler that the files are not standard text files; therefore these flags are mutually exclusive. The spooling daemon uses the appropriate filters to print the data if you specify one of these flags.
The lpr command supports the following flags:
−cAssumes that the files contain data produced by the cifplot filter.
−C class
Specifies a print class as the request classification on the burst page.
−dAssumes that files contain data from tex (DVI format from Stanford University).
−fInterprets the first character of each line as a standard FORTRAN carriage control character.
−gAssumes that files contain standard plot data as produced by plot routines.
−hSuppresses the printing of the burst page.
−i [number]
Indents the output number spaces. If number is not given, the indentation is 8 spaces.
−ItraySelects the input paper tray that supplies paper for the print job. The tray name is printer dependent. The following list shows the tray variable specification for the printers that support the −I flag:
ln05 and ln05r printers:
−Icassette|upper|manual
ln06 and ln06r printers:
−Iupper|envelope_feeder|lower|manual
ln07 and ln07r printers:
−Iupper|manual|lower|cassette
ln08 and ln08r printers:
−Ienvelope_feeder|mmf|manual|upper| lower|lcit
For more information on the input options, refer to the documentation for your printer.
If you have one of the previously listed printers connected locally, there are two additional forms of the −I flag. You can specify the flag in the form −Itray_nametray, where the tray_name variable specifies the name of a tray that is supported by the particular printer (for example, −Ilettertray). You also can specify the flag in the form −In, where the n variable specifies an integer value. Refer to your printer documentation for information on specifying valid tray selections.
−jCauses the request ID of the printer request to be displayed on standard output after it is entered in the print spooling queue.
−J name
Specifies the request name to appear on the burst page. Normally, the lpr command uses the name of the first file.
−KsidesPrints the job in a way specified by the sides variable. You can specify sides as follows:
1 or one_sided or one_sided_simplex
Prints only on one side of the sheet.
2 or two_sided or two_sided_duplex
Prints on both sides of the sheet; the second side is reached by flipping the sheet about its left edge, as in the binding of a book.
tumble or two_sided_tumble
Prints on both sides of the sheet, but prints the opposite way up on each side, so the second side can be read by flipping the sheet along its top axis.
one_sided_duplex
Prints only on one side of the sheet, but retains the page layout intended for two_sided_duplex printing. The layout refers to such things as where the margins are and where the page numbers are.
one_sided_tumble
Prints only on one side of the paper, but retains the page layout intended for tumble printing.
two_sided_simplex
Prints on two sides of the paper, but retains the page layout intended for one_sided_simplex printing.
−lPrints control characters and suppresses page breaks.
−mSends mail (see the mailx command) when spooling is completed.
−nAssumes that files contain data from ditroff (device independent troff). Digital UNIX does not supply ditroff, so this flag might not apply to your system.
−Nnumber
Prints one or more pages on one sheet of paper. The printer automatically adjusts to handle the number of pages printed on one sheet of paper. The maximum that may be specified is 100 pages.
−onSelects the output tray where the printed job will be deposited. The n variable specifies an integer value that depends on the printer. Refer to your printer documentation to determine the correct values.
−Oorientation
Prints the page in the way specified by the orientation variable, which can be the following:
portraitThe printed output is parallel to the short side of the page.
landscapeThe printed output is parallel to the long side of the page.
−pFormats the files using pr as a filter.
−Pprinter
Specifies printer as the output device (print job destination). If you do not specify the −P flag, the default printer or the value of the PRINTER environment variable is used.
−rRemoves the file when spooling or printing is completed.
−sUses symbolic links to print. Usually, files are copied to the spooling directory, but the −s flag uses symlink() to link data files, rather than trying to copy them. This allows you to print large files. If you specify the −s flag, files should not be modified or removed until they have been printed.
−tAssumes that files contain data from troff (cat phototypesetter commands) binary data. Digital UNIX does not supply troff, so this binary data might not exist on your system.
−T titleSpecifies the title to be used by the pr command instead of the filename. The −p flag also must be specified.
−vAssumes that the files contain a raster image for devices like the Benson Varian.
−wnumber
Defines the page width for the pr command.
−xAssumes the files do not require filtering before printing.
−#number
Produces number copies of the output.
−1 font, −2 font, −3 font, −4 font
Mounts the specified font on font position 1, 2, 3, or 4, respectively.
DESCRIPTION
The lpr command uses the lpd spooling daemon to print files.
If you specify a hyphen (−) for a file name, the lpr command reads from standard input; this can be used in conjunction with specified file names.
If you do not specify a particular printer with the −P flag, the default printer or the value of the PRINTER environment variable is used.
To check the status of a printer, use either the lpq or lpstat command. To cancel printer requests, use the lprm or cancel command.
NOTES
1.Digital UNIX does not include ditroff or troff.
2.If you try to print too large a file, the file is truncated. The lpr command does not print binary files. If a user other than the root user prints a file and spooling is disabled, lpr will print a message and will not put requests in the queue. If a connection to lpd on the local machine cannot be made, lpr will indicate that the daemon cannot be started.
3.Fonts for troff and text reside on the host with the printer. Currently, it is not possible to use local font libraries. Digital UNIX does not supply troff, so local font libraries for troff might not exist on your system.
EXAMPLES
The following example prints three copies of the new.index.c, print.index.c, and more.c files:
# lpr −#3 new.index.c print.index.c more.c
The following example prints three copies of the concatenated new.index.c, print.index.c, and more.c files:
# cat new.index.c print.index.c more.c | lpr −#3
The following example prints Operations on the burst page instead of the node name before printing the new.index.c file:
# lpr −C Operations new.index.c
FILES
/etc/passwd
User information
/etc/printcap
Printer description file
/usr/lbin/lpd
Line printer daemon
/var/spool/∗
Spool directories
/var/spool/∗/cf∗
Daemon control files
/var/spool/∗/df∗
Data files specified in cf files
/var/spool/∗/tf∗
Temporary copies of cf files
RELATED INFORMATION
Commands: lp(1), cancel(1), lpc(8), lpd(8), lpq(1), lprm(1), lpstat(1), mailx(1)/Mail(1), pr(1).
Commands: nroff, tbl, neqn, neqn, checkeq, checknr
Functions: symlink(2).