Initial import from FreeBSD RELENG_4:
[games.git] / usr.sbin / lpr / lpc / lpc.8
1 .\" Copyright (c) 1983, 1991, 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 .\"     @(#)lpc.8       8.5 (Berkeley) 4/28/95
33 .\" $FreeBSD: src/usr.sbin/lpr/lpc/lpc.8,v 1.8.2.13 2003/03/12 22:08:14 trhodes Exp $
34 .\"
35 .Dd July 16, 2002
36 .Dt LPC 8
37 .Os
38 .Sh NAME
39 .Nm lpc
40 .Nd line printer control program
41 .Sh SYNOPSIS
42 .Nm
43 .Op Ar command Op Ar argument ...
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility is used by the system administrator to control the
48 operation of the line printer system.
49 For each line printer configured in
50 .Pa /etc/printcap ,
51 .Nm
52 may be used to:
53 .Bl -bullet -offset indent
54 .It
55 disable or enable a printer,
56 .It
57 disable or enable a printer's spooling queue,
58 .It
59 rearrange the order of jobs in a spooling queue,
60 .It
61 find the status of printers, and their associated
62 spooling queues and printer daemons,
63 .It
64 change the status message for printer queues (the status message
65 may be seen by users as part of the output of the
66 .Xr lpq 1
67 utility).
68 .El
69 .Pp
70 Without any arguments,
71 .Nm
72 will prompt for commands from the standard input.
73 If arguments are supplied,
74 .Nm
75 interprets the first argument as a command and the remaining
76 arguments as parameters to the command.
77 The standard input
78 may be redirected causing
79 .Nm
80 to read commands from file.
81 Commands may be abbreviated;
82 the following is the list of recognized commands.
83 .Pp
84 .Bl -tag -width indent -compact
85 .It Ic \&? Op Ar command ...
86 .It Ic help Op Ar command ...
87 Print a short description of each command specified in the argument list,
88 or, if no argument is given, a list of the recognized commands.
89 .Pp
90 .It Ic abort Brq Cm all | Ar printer
91 Terminate an active spooling daemon on the local host immediately and
92 then disable printing (preventing new daemons from being started by
93 .Xr lpr 1 )
94 for the specified printers.
95 .Pp
96 .It Ic bottomq Ar printer Op Ar jobspec ...
97 Take the specified jobs in the order specified and move them to the
98 bottom of the printer queue.
99 Each
100 .Ar jobspec
101 can match multiple print jobs.
102 The full description of a
103 .Ar jobspec
104 is given below.
105 .Pp
106 .It Ic clean Brq Cm all | Ar printer
107 Remove any temporary files, data files, and control files that cannot
108 be printed (i.e., do not form a complete printer job)
109 from the specified printer queue(s) on the local machine.
110 This command will also look for
111 .Pa core
112 files in spool directory
113 for each printer queue, and list any that are found.
114 It will not remove any
115 .Pa core
116 files.
117 See also the
118 .Ic tclean
119 command.
120 .Pp
121 .It Ic disable Brq Cm all | Ar printer
122 Turn the specified printer queues off.
123 This prevents new
124 printer jobs from being entered into the queue by
125 .Xr lpr 1 .
126 .Pp
127 .It Ic down Bro Cm all | Ar printer ... Brc Cm -msg Ar message ...
128 .It Ic down Bro Cm all | Ar printer Brc Ar message ...
129 Turn the specified printer queue off, disable printing and put
130 .Ar message
131 in the printer status file.
132 When specifying more than one printer queue, the
133 .Ic -msg
134 argument is required to separate the list of printers from the text
135 that will be the new status message.
136 The message doesn't need to be quoted, the
137 remaining arguments are treated like
138 .Xr echo 1 .
139 This is normally used to take a printer down, and let other users
140 find out why it is down (the
141 .Xr lpq 1
142 utility will indicate that the printer is down and will print the
143 status message).
144 .Pp
145 .It Ic enable Brq Cm all | Ar printer
146 Enable spooling on the local queue for the listed printers.
147 This will allow
148 .Xr lpr 1
149 to put new jobs in the spool queue.
150 .Pp
151 .It Ic exit
152 .It Ic quit
153 Exit from
154 .Nm .
155 .Pp
156 .It Ic restart Brq Cm all | Ar printer
157 Attempt to start a new printer daemon.
158 This is useful when some abnormal condition causes the daemon to
159 die unexpectedly, leaving jobs in the queue.
160 .Xr lpq 1
161 will report that there is no daemon present when this condition occurs.
162 If the user is the super-user,
163 try to abort the current daemon first (i.e., kill and restart a stuck daemon).
164 .Pp
165 .It Ic setstatus Bro Cm all | Ar printer Brc Cm -msg Ar message ...
166 Set the status message for the specified printers.
167 The
168 .Ic -msg
169 argument is required to separate the list of printers from the text
170 that will be the new status message.
171 This is normally used to change the status message when the printer
172 queue is no longer active after printing has been disabled, and you
173 want to change what users will see in the output of the
174 .Xr lpq 1 utility.
175 .Pp
176 .It Ic start Brq Cm all | Ar printer
177 Enable printing and start a spooling daemon for the listed printers.
178 .Pp
179 .It Ic status Brq Cm all | Ar printer
180 Display the status of daemons and queues on the local machine.
181 .Pp
182 .It Ic stop Brq Cm all | Ar printer
183 Stop a spooling daemon after the current job completes and disable
184 printing.
185 .Pp
186 .It Ic tclean Brq Cm all | Ar printer
187 This will do a test-run of the
188 .Ic clean
189 command.
190 All the same checking is done, but the command will only print out
191 messages saying what a similar
192 .Ic clean
193 command would do if the user typed it in.
194 It will not remove any files.
195 Note that the
196 .Ic clean
197 command is a privileged command, while the
198 .Ic tclean
199 command is not restricted.
200 .Pp
201 .It Ic topq Ar printer Op Ar jobspec ...
202 Take the specified jobs in the order specified and move them to the
203 top of the printer queue.
204 Each
205 .Ar jobspec
206 can match multiple print jobs.
207 The full description of a
208 .Ar jobspec
209 is given below.
210 .Pp
211 .It Ic up Brq Cm all | Ar printer
212 Enable everything and start a new printer daemon.
213 Undoes the effects of
214 .Ic down .
215 .El
216 .Pp
217 Commands such as
218 .Ic topq
219 and
220 .Ic bottomq
221 can take one or more
222 .Ar jobspec
223 to specify which jobs the command should operate on.
224 A
225 .Ar jobspec
226 can be:
227 .Bl -bullet
228 .It
229 a single job number, which will match all jobs in the printer's queue
230 which have the same job number.
231 Eg:
232 .Ar 17 ,
233 .It
234 a range of job numbers, which will match all jobs with a number between
235 the starting and ending job numbers, inclusive.
236 Eg:
237 .Ar 21-32 ,
238 .It
239 a specific userid, which will match all jobs which were sent by that
240 user.
241 Eg:
242 .Ar jones ,
243 .It
244 a host name, when prefixed by an `@', which will match all jobs in
245 the queue which were sent from the given host.
246 Eg:
247 .Ar @freebsd.org ,
248 .It
249 a job range and a userid, separated by a `:', which will match all jobs
250 which both match the job range and were sent by the specified user.
251 Eg:
252 .Ar jones:17
253 or
254 .Ar 21-32:jones ,
255 .It
256 a job range and/or a userid, followed by a host name, which will match
257 all jobs which match all the specified criteria.
258 Eg:
259 .Ar jones@freebsd.org
260 or
261 .Ar 21-32@freebsd.org
262 or
263 .Ar jones:17@freebsd.org .
264 .El
265 .Pp
266 The values for userid and host name can also include pattern-matching
267 characters, similar to the pattern matching done for filenames in
268 most command shells.
269 Note that if you enter a
270 .Ic topq
271 or
272 .Ic bottomq
273 command as parameters on the initial
274 .Nm
275 command, then the shell will expand any pattern-matching characters
276 that it can (based on what files in finds in the current directory)
277 before
278 .Nm
279 processes the command.
280 In that case, any parameters which include pattern-matching characters
281 should be enclosed in quotes, so that the shell will not try to
282 expand them.
283 .Sh FILES
284 .Bl -tag -width /var/spool/*/lockx -compact
285 .It Pa /etc/printcap
286 printer description file
287 .It Pa /var/spool/*
288 spool directories
289 .It Pa /var/spool/*/lock
290 lock file for queue control
291 .El
292 .Sh SEE ALSO
293 .Xr lpq 1 ,
294 .Xr lpr 1 ,
295 .Xr lprm 1 ,
296 .Xr printcap 5 ,
297 .Xr chkprintcap 8 ,
298 .Xr lpd 8
299 .Sh DIAGNOSTICS
300 .Bl -diag
301 .It "?Ambiguous command"
302 abbreviation matches more than one command
303 .It "?Invalid command"
304 no match was found
305 .It "?Privileged command"
306 you must be a member of group "operator" or root to execute this command
307 .El
308 .Sh HISTORY
309 The
310 .Nm
311 utility appeared in
312 .Bx 4.2 .