1.\" $OpenBSD: lpr.1,v 1.11 2007/05/31 19:20:25 jmc Exp $ 2.\" $NetBSD: lpr.1,v 1.10 2002/01/19 03:23:26 wiz Exp $ 3.\" 4.\" Copyright (c) 1980, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)lpr.1 8.1 (Berkeley) 6/6/93 32.\" 33.Dd $Mdocdate: May 31 2007 $ 34.Dt LPR 1 35.Os 36.Sh NAME 37.Nm lpr 38.Nd off line print 39.Sh SYNOPSIS 40.Nm lpr 41.Bk -words 42.Op Fl cdfghlmnpqrstv 43.Op Fl # Ns Ar num 44.Op Fl 1234 Ar font 45.Op Fl C Ar class 46.Op Fl i Op Ar numcols 47.Op Fl J Ar job 48.Op Fl P Ns Ar printer 49.Op Fl T Ar title 50.Op Fl U Ar user 51.Op Fl w Ns Ar num 52.Op Ar name ... 53.Sh DESCRIPTION 54.Nm lpr 55uses a spooling daemon to print the named files when facilities 56become available. 57If no names appear, the standard input is assumed. 58.Pp 59The following single letter options are used to notify the line printer 60spooler that the files are not standard text files. 61The spooling daemon will 62use the appropriate filters to print the data accordingly. 63.Bl -tag -width indent 64.It Fl c 65The files are assumed to contain data produced by 66.Ic cifplot . 67.It Fl d 68The files are assumed to contain data from 69.Em tex 70.Pf ( Tn DVI 71format from Stanford). 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 g 78The files are assumed to contain standard plot data as produced by the 79.Ic plot 80routines (see also 81.Xr plot 82for the filters used by the printer spooler). 83.It Fl l 84Use a filter which allows control characters to be printed and suppresses 85page breaks. 86.It Fl n 87The files are assumed to contain data from 88.Em ditroff 89(device independent troff). 90.It Fl p 91Use 92.Xr pr 1 93to format the files. 94.It Fl t 95The files are assumed to contain data from 96.Xr troff 1 97(cat phototypesetter commands). 98.It Fl v 99The files are assumed to contain a raster image for devices like the 100Benson Varian. 101.El 102.Pp 103These options apply to the handling of 104the print job: 105.Bl -tag -width indent 106.It Fl h 107Suppress the printing of the burst page. 108.It Fl m 109Send mail upon completion. 110.It Fl P Ns Ar printer 111Force output to a specific printer. 112Normally, the default printer is used (site dependent), or the value of the 113environment variable 114.Ev PRINTER 115is used. 116.It Fl q 117Queue the print job but do not start the spooling daemon. 118.It Fl r 119Remove the file upon completion of spooling or upon completion of 120printing (with the 121.Fl s 122option). 123.It Fl s 124Use symbolic links. 125Usually files are copied to the spool directory. 126The 127.Fl s 128option will use 129.Xr symlink 2 130to link data files rather than trying to copy them so large files can be 131printed. 132This means the files should 133not be modified or removed until they have been printed. 134.El 135.Pp 136The remaining options apply to copies, the page display, and headers: 137.Bl -tag -width indent 138.It Fl # Ns Ar num 139The quantity 140.Ar num 141is the number of copies desired of each file named. 142For example, 143.Bd -literal -offset indent 144$ lpr \-#3 foo.c bar.c more.c 145.Ed 146.Pp 147would result in 3 copies of the file foo.c, followed by 3 copies 148of the file bar.c, etc. 149On the other hand, 150.Bd -literal -offset indent 151$ cat foo.c bar.c more.c \&| lpr \-#3 152.Ed 153.Pp 154will give three copies of the concatenation of the files. 155Often a site will disable this feature to encourage use of a photocopier 156instead. 157.It Fl 1234 Ar font 158Specifies a 159.Ar font 160to be mounted on font position 161.Ar i . 162The daemon 163will construct a 164.Li .railmag 165file referencing 166the font pathname. 167.It Fl C Ar class 168Job classification 169to use on the burst page. 170For example, 171.Bd -literal -offset indent 172$ lpr \-C EECS foo.c 173.Ed 174.Pp 175causes the system name (the name returned by 176.Xr hostname 1 ) 177to be replaced on the burst page by 178.Tn EECS , 179and the file foo.c to be printed. 180.It Fl i Op Ar numcols 181The output is indented. 182If the next argument is numeric 183.Pq Ar numcols , 184it is used as the number of blanks to be printed before each 185line; otherwise, 8 characters are 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 T Ar title 190Title name for 191.Xr pr 1 , 192instead of the file name. 193.It Fl U Ar user 194User name to print on the burst page, 195also for accounting purposes. 196This option is only honored if the real user ID is daemon 197(or that specified in the printcap file instead of daemon), 198and is intended for those instances where print filters wish to requeue jobs. 199.It Fl w Ns Ar num 200Uses 201.Ar num 202as the page width for 203.Xr pr 1 . 204.El 205.Sh ENVIRONMENT 206If the following environment variable exists, it is used by 207.Nm lpr : 208.Bl -tag -width PRINTER 209.It Ev PRINTER 210Specifies an alternate default printer. 211.El 212.Sh FILES 213.Bl -tag -width /var/spool/output/*/tf* -compact 214.It Pa /etc/passwd 215local users database 216.It Pa /etc/printcap 217printer capabilities database 218.It Pa /usr/sbin/lpd* 219line printer daemons 220.It Pa /var/spool/output/* 221directories used for spooling 222.It Pa /var/spool/output/*/cf* 223daemon control files 224.It Pa /var/spool/output/*/df* 225data files specified in 226.Dq cf 227files 228.It Pa /var/spool/output/*/tf* 229temporary copies of 230.Dq cf 231files 232.El 233.Sh DIAGNOSTICS 234If you try to spool too large a file, it will be truncated. 235If a user other than root prints a file and spooling is disabled, 236.Nm 237will print a message saying so and will not put jobs in the queue. 238If a connection to 239.Xr lpd 8 240on the local machine cannot be made, 241.Nm 242will say that the daemon cannot be started. 243Diagnostics may be printed in the daemon's log file 244regarding missing spool files by 245.Xr lpd 8 . 246.Sh SEE ALSO 247.Xr lpq 1 , 248.Xr lprm 1 , 249.Xr pr 1 , 250.Xr symlink 2 , 251.Xr printcap 5 , 252.Xr lpc 8 , 253.Xr lpd 8 254.Sh HISTORY 255The 256.Nm 257command appeared in 258.Bx 3 . 259.Sh BUGS 260Fonts for 261.Xr troff 1 262and 263.Xr tex 264reside on the host with the printer. 265It is currently not possible to use local font libraries. 266