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