summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man1/lpq.1
blob: 8330110611d62fff7b61b3dae8ae87700d96b3ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
.TH LPQ 1 2007-02-24 "LPRng" "lpq command"
.SH NAME
lpq \- spool queue examination program
.SH SYNOPSIS
.B lpq
.RB [ \-a ]
.RB [ \-A ]
.RB [ \-l ]
.RB [ \-L ]
.RB [ \-V ]
.RB [ \-c ]
.RB [ \-v ]
.RB [ \-P
.IR " printer" ]
.RB [ \-s ]
.RB [ -t
.IR " sleeptime" ]
.RB [ \-D
.IR " debugopt" ]
.RI [  jobid \|.\|.\|.]
.SH DESCRIPTION
.I lpq
requests a status report from
.IR lpd (8)
on the specified printers or jobs.
.I lpq
invoked without any arguments
reports on the printer given by the default printer
(see
.B \-P
option).
The short (default) format simply lists
the printer, host, and numbers of jobs in the spool queue.
When using the long format (-l option),
for each job in a spool queue
.I lpq
reports the job identifier
which is generated from the user's name and originating host,
current rank in the queue,
the job number (which may be supplied to
.IR lprm (1)
for removing a specific job),
the job description information,
and the total size in bytes.
If there is an error or other problem with the job,
this information may be modified to reflect the problems.
In a spool queue,
Job ordering is a modified FIFO (First in First Out),
modified by the job class and priority information.
.PP
The following options are available.
.TP
.B \-A
Use authentication specified by the value of the AUTH environment variable.
.TP
.BI "\-D " debugoptions
Debugging is controlled using the
.B \-D
option. This accepts a comma-separated list of debugging
settings. These settings take one of two forms: 
.B facility=value , 
or
.B value 
to set an overall default value.
.TP
.BI "\-P " printer
By default,
the destination printer
is taken from
the command line
.I printer
value,
then
the environment variables
PRINTER,
LPDEST,
NPRINTER,
NGPRINTER,
then first entry in the printcap information,
and and finally the default_printer entry from the
configuration file,
and then the compile time default.
.TP
.B "\-V"
Print version information.
.TP
.B "\-v"
Dump lpd related information.
.TP
.B "\-c"
Clear Screen before output, very usefull with \-t
.TP
.B "\-a"
List status for all printers (see PRINTER LISTS below)
which have entries for the LPRng client programs
in the
.IR printcap (5)
database.
.TP
.B "\-l"
Increase verbosity of the \fBl\fRong display format.
A single -l options selects a short verbose display,
multiple -l options increase the verbosity.
.TP
.B "\-L"
Use maximum verbosity for the \fBl\fRong display format.
.TP
.B "\-s"
Display a short, single line status summary for each queue and subqueue.
.TP
.BI "\-t " sleeptime
Forces
.I lpq
to periodically display the spool queues and then sleep
.I sleeptime
seconds between scans of the queue.
.IP "jobid ... all"
The options are followed by
a list of jobids which
are used to select jobs of interest.
A jobid can be a user name,
a job identifier,
a job number,
or a glob based pattern which will be applied to the
job identifiers.
The all keyword will display all jobs and is the default option.
.PP
The
.I lpq
will report the status of the spool queue (enabled for spooling,
disabled for unspooling),
and the absence of a server if unspooling is enabled.
The
.IR lpc (1)
command
.I "lpc start <printer>"
may be used to start the server if this is the case.
.SH ENVIRONMENT
By default,
the destination printer
is taken from
the command line
.I dest
value,
then
the environment variables
PRINTER,
LPDEST,
NPRINTER,
NGPRINTER,
then first entry in the printcap information,
and and finally the default_printer entry from the
configuration file,
and then the compile time default.
.SH "PRINTER LISTS"
The
.B -a
option is used to by
.IR lpq (1)
to get status for a list of printers.
This list is formed as follows.
.IP 1)
The printcap file is scanned for printer entries.
Only entries with names starting with a
letter or digit are recognized as valid queue or printer names.
.IP 2)
If the special entry
.I all
is present,
and it has a field
.I ":all=pr1@host1,pr2@host2,..."
then the printers
.IR pr1 ,
.IR pr2 ,
\&...
are used as the printer or queue list.
.IP 3)
If there is no all entry,
then the original list of printers found in
step 1)
is used as the list of printers. 
.PP
The special case of
.B "lpq -Pall"
disables the searching of the printcap database,
and simply sends a query to the lpd server for status
of printer
.BR all .
The
.IR lpd (8)
server enumerates the printers in its printcap file,
ignoring any
.I all
entry,
and returns status only for printers which have entries in the
.IR lpd (8)
server printcap file.
.PP
Finally,
the special case
.B "lpq -Ppr@host"
causes
.IR lpq (1)
to send a status request for printer
.B pr
to host
.BR host .
.PP
Here is a simple set of rules to use:
.nf
.ft CW
Client:
 pr1:lp=%P@server
 pr2:lp=%P@server
  - printer pr1 followed by pr2

pr1:lp=%P@server
pr2:lp=%P@server
all:all=pr2,pr1
  - printer pr2 followed by pr1 (all overrides)

Client:
 pr1:lp=%P@server
 pr2:lp=%P@server
Server:
 lp:lp=...
  lpq -Pall
    - status returned only for printer 'lp'
.fi
.SH "EXIT STATUS"
The following exit values are returned:
.TP 15
.B "zero (0)"
Successful completion.
.TP
.B "non-zero (!=0)"
An error occurred.
.SH "PRINTCAP INFORMATION"
The printer names and other information is obtained by using a printcap
file or some other database.
The ${HOME}/.printcap
file can be used to specify user level options and configuration
information.
See
.IR printcap (5)
for more information.
.SH FILES
The files used by LPRng are set by values in the
printer configuration file.
The following are a commonly used set of default values.
.nf
.ta \w'/var/spool/lpd/printcap.<hostname>           'u
/etc/lprng/lpd.conf	LPRng configuration file
${HOME}/.printcap	user printer description file
/etc/printcap	printer description file
/etc/lprng/lpd.perms	permissions
/var/run/lprng/lpd	lock file for queue control
/var/spool/lpd		spool directories
/var/spool/lpd/QUEUE/control	queue control
/var/spool/lpd/QUEUE/log	trace or debug log file
/var/spool/lpd/QUEUE/acct	accounting file
/var/spool/lpd/QUEUE/status	status file
.fi
.SH "SEE ALSO"
.BR lpd.conf (5),
.BR lpc (8),
.BR lpd (8),
.BR checkpc (8),
.BR lpr (1),
.BR lprm (1),
.BR printcap (5),
.BR lpd.perms (5),
.BR pr (1).
.SH "AUTHOR"
Patrick Powell <papowell@lprng.com>.
.SH DIAGNOSTICS
Most of the diagnostics are self explanatory.
If you are puzzled over the exact cause of failure,
set the debugging level on (-D5) and run again.
The debugging information will 
help you to pinpoint the exact cause of failure.
.SH "HISTORY"
LPRng is a enhanced printer spooler system
with functionality similar to the Berkeley LPR software.
The LPRng developer mailing list is lprng-devel@lists.sourceforge.net;
subscribe by visiting 
.B https://lists.sourceforge.net/lists/listinfo/lprng-devel
or sending mail to 
.B lprng-request@lists.sourceforge.net
with
the word 
.I subscribe 
in the body.
.br
The software is available via 
.B http://lprng.sourceforge.net