When you print with lpr
, the data you wish to print
is put together in a package called a print job, which
is sent to the LPD spooling system. Each printer has a
queue of jobs, and your job waits in that queue along with
other jobs from yourself and from other users. The printer
prints those jobs in a first-come, first-served order.
To display the queue for the default printer, type lpq
.
For a specific printer, use the -P
option. For
example, the command
lpq -P bamboo
shows the queue for the printer named bamboo
. Here's
an example of the output of the lpq
command:
bamboo is ready and printing
Rank Owner Job Files Total Size
active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes
2nd kelly 10 (standard input) 1635 bytes
3rd mary 11 ... 78519 bytes
This shows three jobs in the queue for bamboo
. The
first job, submitted by user kelly, got assigned job
number 9. Every job for a printer gets a unique job
number. Most of the time you can ignore the job number, but
you'll need it if you want to cancel the job; see section
Removing Jobs
for details.
Job number nine consists of two files; multiple files given
on the lpr
command line are treated as part of a single
job. It's the currently active job (note the word
active
under the ``Rank'' column), which means the
printer should be currently printing that job. The second
job consists of data passed as the standard input to the
lpr
command. The third job came from user mary; it's a
much larger job. The pathname of the files she's trying to
print is too long to fit, so the lpq
command just shows
three dots.
The very first line of the output from lpq
is also
useful: it tells what the printer is currently doing (or at
least what LPD thinks the printer is doing).
The lpq
command also support a -l
option to
generate a detailed long listing. Here's an example of
lpq -l
:
waiting for bamboo to become ready (offline ?)
kelly: 1st [job 009rose]
/etc/host.conf 73 bytes
/etc/hosts.equiv 15 bytes
kelly: 2nd [job 010rose]
(standard input) 1635 bytes
mary: 3rd [job 011rose]
/home/orchid/mary/research/venus/alpha-regio/mapping 78519 bytes