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