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