xref: /openbsd/usr.sbin/lpr/lpr/lpr.1 (revision 01c04610)
1.\"	$OpenBSD: lpr.1,v 1.16 2020/02/08 01:09:58 jsg 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: February 8 2020 $
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.Ek
54.Sh DESCRIPTION
55.Nm lpr
56uses a spooling daemon to print the named files when facilities
57become available.
58If no names appear, the standard input is assumed.
59.Pp
60The following single letter options are used to notify the line printer
61spooler that the files are not standard text files.
62The spooling daemon will
63use the appropriate filters to print the data accordingly.
64.Bl -tag -width indent
65.It Fl c
66The files are assumed to contain data produced by
67.Ic cifplot .
68.It Fl d
69The files are assumed to contain data from
70.Em tex
71.Pf ( Tn DVI
72format from Stanford).
73.It Fl f
74Use a filter which interprets the first character of each line as a
75standard
76.Tn FORTRAN
77carriage control character.
78.It Fl g
79The files are assumed to contain standard plot data as produced by the
80.Ic plot
81routines.
82.It Fl l
83Use a filter which allows control characters to be printed and suppresses
84page breaks.
85.It Fl n
86The files are assumed to contain data from
87.Em ditroff
88(device independent troff).
89.It Fl p
90Use
91.Xr pr 1
92to format the files.
93.It Fl t
94The files are assumed to contain data from
95troff (cat phototypesetter commands).
96.It Fl v
97The files are assumed to contain a raster image for devices like the
98Benson Varian.
99.El
100.Pp
101These options apply to the handling of
102the print job:
103.Bl -tag -width indent
104.It Fl h
105Suppress the printing of the burst page.
106.It Fl m
107Send mail upon completion.
108.It Fl P Ns Ar printer
109Force output to a specific printer.
110Normally, the default printer is used (site dependent), or the value of the
111environment variable
112.Ev PRINTER
113is used.
114.It Fl q
115Queue the print job but do not start the spooling daemon.
116.It Fl r
117Remove the file upon completion of spooling or upon completion of
118printing (with the
119.Fl s
120option).
121.It Fl s
122Use symbolic links.
123Usually files are copied to the spool directory.
124The
125.Fl s
126option will use
127.Xr symlink 2
128to link data files rather than trying to copy them so large files can be
129printed.
130This means the files should
131not be modified or removed until they have been printed.
132.El
133.Pp
134The remaining options apply to copies, the page display, and headers:
135.Bl -tag -width indent
136.It Fl # Ns Ar num
137The quantity
138.Ar num
139is the number of copies desired of each file named.
140For example,
141.Bd -literal -offset indent
142$ lpr -#3 foo.c bar.c more.c
143.Ed
144.Pp
145would result in 3 copies of the file foo.c, followed by 3 copies
146of the file bar.c, etc.
147On the other hand,
148.Bd -literal -offset indent
149$ cat foo.c bar.c more.c | lpr -#3
150.Ed
151.Pp
152will give three copies of the concatenation of the files.
153Often a site will disable this feature to encourage use of a photocopier
154instead.
155.It Fl 1234 Ar font
156Specifies a
157.Ar font
158to be mounted on font position
159.Ar i .
160The daemon
161will construct a
162.Li .railmag
163file referencing
164the font pathname.
165.It Fl C Ar class
166Job classification
167to use on the burst page.
168For example,
169.Bd -literal -offset indent
170$ lpr \-C EECS foo.c
171.Ed
172.Pp
173causes the system name (the name returned by
174.Xr hostname 1 )
175to be replaced on the burst page by
176.Tn EECS ,
177and the file foo.c to be printed.
178.It Fl i Op Ar numcols
179The output is indented.
180If the next argument is numeric
181.Pq Ar numcols ,
182it is used as the number of blanks to be printed before each
183line; otherwise, 8 characters are printed.
184.It Fl J Ar job
185Job name to print on the burst page.
186Normally, the first file's name is used.
187.It Fl T Ar title
188Title name for
189.Xr pr 1 ,
190instead of the file name.
191.It Fl U Ar user
192User name to print on the burst page,
193also for accounting purposes.
194This option is only honored if the real user ID is daemon
195(or that specified in the printcap file instead of daemon),
196and is intended for those instances where print filters wish to requeue jobs.
197.It Fl w Ns Ar num
198Uses
199.Ar num
200as the page width for
201.Xr pr 1 .
202.El
203.Sh ENVIRONMENT
204If the following environment variable exists, it is used by
205.Nm lpr :
206.Bl -tag -width PRINTER
207.It Ev PRINTER
208Specifies an alternate default printer.
209.El
210.Sh FILES
211.Bl -tag -width /var/spool/output/*/tf* -compact
212.It Pa /etc/passwd
213local users database
214.It Pa /etc/printcap
215printer capabilities database
216.It Pa /usr/sbin/lpd*
217line printer daemons
218.It Pa /var/spool/output/*
219directories used for spooling
220.It Pa /var/spool/output/*/cf*
221daemon control files
222.It Pa /var/spool/output/*/df*
223data files specified in
224.Dq cf
225files
226.It Pa /var/spool/output/*/tf*
227temporary copies of
228.Dq cf
229files
230.El
231.Sh DIAGNOSTICS
232If you try to spool too large a file, it will be truncated.
233If a user other than root prints a file and spooling is disabled,
234.Nm
235will print a message saying so and will not put jobs in the queue.
236If a connection to
237.Xr lpd 8
238on the local machine cannot be made,
239.Nm
240will say that the daemon cannot be started.
241Diagnostics may be printed in the daemon's log file
242regarding missing spool files by
243.Xr lpd 8 .
244.Sh SEE ALSO
245.Xr lpq 1 ,
246.Xr lprm 1 ,
247.Xr pr 1 ,
248.Xr symlink 2 ,
249.Xr printcap 5 ,
250.Xr lpc 8 ,
251.Xr lpd 8
252.Sh HISTORY
253The
254.Nm
255command appeared in
256.At v5 .
257.Sh BUGS
258Fonts for troff and tex reside on the host with the printer.
259It is currently not possible to use local font libraries.
260