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