1.\" Copyright (c) 1980, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" From @(#)lpr.1 8.1 (Berkeley) 6/6/93 29.\" $FreeBSD: src/usr.sbin/lpr/lpr/lpr.1,v 1.11.2.6 2002/06/21 16:40:52 charnier Exp $ 30.\" 31.Dd February 20, 2022 32.Dt LPR 1 33.Os 34.Sh NAME 35.Nm lpr 36.Nd off line print 37.Sh SYNOPSIS 38.Nm 39.Op Fl P Ns Ar printer 40.Op Fl \&# Ns Ar num 41.Op Fl C Ar class 42.Op Fl J Ar job 43.Op Fl L Ar locale 44.Op Fl T Ar title 45.Op Fl U Ar user 46.Op Fl Z Ar daemon-options 47.Op Fl i Op Ar numcols 48.Op Fl 1234 Ar font 49.Op Fl w Ar num 50.Op Fl cdfghlnmprstv 51.Op Ar name ... 52.Sh DESCRIPTION 53The 54.Nm 55utility uses a spooling daemon to print the named files when facilities 56become available. If no names appear, the standard input is assumed. 57.Pp 58The following single letter options are used to notify the line printer 59spooler that the files are not standard text files. 60The spooling daemon will 61use the appropriate filters to print the data accordingly. 62Note that not all spoolers implement filters for all data types, 63and some sites may use these types for other purposes than the ones 64described here. 65.Bl -tag -width indent 66.It Fl d 67The files are assumed to contain data in 68.Tn DVI 69format from the 70.Tn TeX 71typesetting system. 72.It Fl f 73Use a filter which interprets the first character of each line as a 74standard 75.Tn FORTRAN 76carriage control character. 77.It Fl l 78Use a filter which allows control characters to be printed and suppresses 79page breaks. 80.It Fl p 81Use 82.Xr pr 1 83to format the files. 84.El 85.Pp 86The following options are historical and not directly supported by any 87software included in 88.Dx . 89.Bl -tag -width indent 90.It Fl c 91The files are assumed to contain data produced by 92.Xr cifplot 1 . 93.It Fl g 94The files are assumed to contain standard plot data as produced by the 95.Ux 96.Xr plot 3 97routines. 98.It Fl n 99The files are assumed to contain data from 100.Em ditroff 101(device independent troff). 102.It Fl t 103The files are assumed to contain 104.Tn C/A/T 105phototypesetter commands from ancient versions of 106.Ux 107.Xr troff 1 . 108.It Fl v 109The files are assumed to contain a raster image for devices like the 110Benson Varian. 111.El 112.Pp 113These options apply to the handling of 114the print job: 115.Bl -tag -width indent 116.It Fl P 117Force output to a specific printer. Normally, 118the default printer is used (site dependent), or the value of the 119environment variable 120.Ev PRINTER 121is used. 122.It Fl h 123Suppress the printing of the burst page. 124.It Fl m 125Send mail upon completion. 126.It Fl r 127Remove the file upon completion of spooling or upon completion of 128printing (with the 129.Fl s 130option). 131.It Fl s 132Use symbolic links. Usually files are copied to the spool directory. 133The 134.Fl s 135option will use 136.Xr symlink 2 137to link data files rather than trying to copy them so large files can be 138printed. This means the files should 139not be modified or removed until they have been printed. 140.El 141.Pp 142The remaining options apply to copies, the page display, and headers: 143.Bl -tag -width indent 144.It Fl \&# Ns Ar num 145The quantity 146.Ar num 147is the number of copies desired of each file named. For example, 148.Bd -literal -offset indent 149lpr \-#3 foo.c bar.c more.c 150.Ed 151would result in 3 copies of the file foo.c, followed by 3 copies 152of the file bar.c, etc. On the other hand, 153.Bd -literal -offset indent 154cat foo.c bar.c more.c \&| lpr \-#3 155.Ed 156.Pp 157will give three copies of the concatenation of the files. 158Often 159a site will disable this feature to encourage use of a photocopier 160instead. 161.It Xo 162.Fl Ns Op Cm 1234 163.Ar font 164.Xc 165Specifies a 166.Ar font 167to be mounted on font position 168.Ar i . 169The daemon 170will construct a 171.Li .railmag 172file referencing 173the font pathname. 174.It Fl C Ar class 175Job classification 176to use on the burst page. For example, 177.Bd -literal -offset indent 178lpr \-C EECS foo.c 179.Ed 180.Pp 181causes the system name (the name returned by 182.Xr hostname 1 ) 183to be replaced on the burst page by 184.Tn EECS , 185and the file foo.c to be printed. 186.It Fl J Ar job 187Job name to print on the burst page. 188Normally, the first file's name is used. 189.It Fl L Ar locale 190Use 191.Ar locale 192specified as argument instead of one found in environment. 193(Only effective when filtering through 194.Xr pr 1 195is requested using the 196.Fl p 197option.) 198.It Fl T Ar title 199Title name for 200.Xr pr 1 , 201instead of the file name. 202.It Fl U Ar user 203User name to print on the burst page, 204also for accounting purposes. 205This option is only honored if the real user-id is daemon 206(or that specified in the printcap file instead of daemon), 207and is intended for those instances where print filters wish to requeue jobs. 208.It Fl Z Ar daemon-options 209Some spoolers, such as 210.Tn LPRng , 211accept additional per-job options using a 212.Ql Z 213control line. 214When 215.Fl Z 216is specified, and 217.Fl p 218.Pq Xr pr 1 219is not requested, the specified 220.Ar daemon-options 221will be passed to the remote 222.Tn LPRng 223spooler. 224.It Fl i Op Ar numcols 225The output is indented by 226.Ar numcols 227columns. 228If 229.Ar numcols 230is unspecified, the default value of 8 columns is used. 231.It Fl w Ar num 232Uses 233.Ar num 234as the page width for 235.Xr pr 1 . 236.El 237.Sh ENVIRONMENT 238If the following environment variable exists, it is used by 239.Nm : 240.Bl -tag -width PRINTER 241.It Ev PRINTER 242Specifies an alternate default printer. 243.El 244.Sh FILES 245.Bl -tag -width /var/spool/output/*/tf* -compact 246.It Pa /etc/passwd 247Personal identification. 248.It Pa /etc/printcap 249Printer capabilities data base. 250.It Pa /usr/sbin/lpd 251Line printer daemons. 252.It Pa /var/spool/output/* 253Directories used for spooling. 254.It Pa /var/spool/output/*/cf* 255Daemon control files. 256.It Pa /var/spool/output/*/df* 257Data files specified in "cf" files. 258.It Pa /var/spool/output/*/tf* 259Temporary copies of "cf" files. 260.El 261.Sh DIAGNOSTICS 262If you try to spool too large a file, it will be truncated. 263The 264.Nm 265utility will object to printing binary files. 266If a user other than root prints a file and spooling is disabled, 267.Nm 268will print a message saying so and will not put jobs in the queue. 269If a connection to 270.Xr lpd 8 271on the local machine cannot be made, 272.Nm 273will say that the daemon cannot be started. 274Diagnostics may be printed in the daemon's log file 275regarding missing spool files by 276.Xr lpd 8 . 277.Sh SEE ALSO 278.Xr lpq 1 , 279.Xr lprm 1 , 280.Xr pr 1 , 281.Xr symlink 2 , 282.Xr printcap 5 , 283.Xr lpc 8 , 284.Xr lpd 8 285.Sh HISTORY 286The 287.Nm 288command appeared in 289.Bx 3 . 290.Sh BUGS 291Fonts for 292.Xr troff 1 293and 294.Tn TeX 295reside on the host with the printer. 296It is currently not possible to 297use local font libraries. 298.Pp 299The 300.Ql Z 301control file line is used for two different purposes; for 302standard 303.Dx 304.Xr lpd 8 , 305it specifies a locale to be passed to 306.Xr pr 1 . 307For 308.Tn LPRng 309.Xr lpd 8 , 310it specifies additional options to be interpreted by the spooler's 311input and output filters. 312When submitting jobs via 313.Nm , 314.Fl p 315.Fl L Ar locale 316is used in the former context, and 317.Fl Z Ar daemon-options 318is used in the latter. 319