LPQ(1) — USER COMMANDS
NAME
lpq − spool queue examination program
SYNOPSIS
lpq [ +[ num ] ] [ −l ] [ −Pprinter ] [ job # ... ] [ user ... ]
DESCRIPTION
lpq examines the spooling area used by lpd(8) for printing files on the line printer, and reports the status of the specified jobs or all jobs associated with a user.
lpq reports on any jobs currently in the queue when invoked without any options. Arguments supplied that are not recognized as options are interpreted as user names or job numbers to filter out only those jobs of interest.
For each job submitted (that is, each invocation of lpr) lpq reports the user’s name, current rank in the queue, the names of files comprising the job, the job identifier (a number which may be supplied to lprm for removing a specific job), and the total size in bytes. Normally, only as much information as will fit on one line is displayed. Job ordering is dependent on the algorithm used to scan the spooling directory and is supposed to be FIFO (First in First Out). File names comprising a job may be unavailable (when lpr is used as a sink in a pipeline) in which case the file is indicated as ‘(standard input)’.
If lpq warns that there is no daemon present (that is, due to some malfunction), the lpc(8) command can be used to restart the printer daemon.
OPTIONS
−Pprinter report the state of the queue to the specified printer. In the absence of the −P option, the queue to the printer specified by the PRINTER variable in the environment is reported on. If the PRINTER variable isn’t set, the default line printer queue is reported.
−ljob # ...
causes information about each of the files comprising the job to be printed.
+nnn display the spool queue until it empties. Supplying a number nnn immediately after the + sign indicates that lpq should sleep nnn seconds in between scans of the queue.
FILES
/etc/termcapfor manipulating the screen for repeated display
/etc/printcap to determine printer characteristics
/usr/spool/∗the spooling directory, as determined from printcap
/usr/spool/∗/cf∗ control files specifying jobs
/usr/spool/∗/lock the lock file to obtain the currently active job
SEE ALSO
lpr(1), lprm(1), lpc(8), lpd(8)
BUGS
The + option doesn’t wait until the entire queue is empty; it only waits until the local machine’s queue is empty.
lpq may report unreliably. The status, as reported, may not always reflect the actual state of the printer.
Output formatting is sensitive to the line length of the terminal; this can result in widely-spaced columns.
lpq is sometimes unable to open various files because the lock file is malformed.
DIAGNOSTICS
Waiting for printer to become ready (offline ?)
The daemon could not open the printer device. This can happen for a number of reasons; the most common is that the printer is turned off-line. This message can also be generated if the printer is out of paper, the paper is jammed, and so on. The actual reason is dependent on the meaning of error codes returned by system device driver. Not all printers supply sufficient information to distinguish when a printer is off-line or having trouble (for example, a printer connected through a serial line). Another possible cause of this message is some other process, such as an output filter, has an exclusive open on the device. Your only recourse here is to kill off the offending program(s) and restart the printer with lpc.
printer is ready and printing
The lpq program checks to see if a daemon process exists for printer and prints the file status. If the daemon is hung, a super user can use lpc to abort the current daemon and start a new one.
waiting for host to come up
Indicates that there is a daemon trying to connect to the remote machine named host in order to send the files in the local queue. If the remote machine is up, lpd on the remote machine is probably dead or hung and should be restarted as mentioned for lpr.
sending to host
The files should be in the process of being transferred to the remote host. If not, the local daemon should be aborted and started with lpc.
Warning: printer is down
The printer has been marked as being unavailable with lpc.
Warning: no daemon present
The lpd process overseeing the spooling queue, as indicated in the “lock” file in that directory, does not exist. This normally occurs only when the daemon has unexpectedly died. The error log file for the printer should be checked for a diagnostic from the deceased process. To restart an lpd, use
% /usr/etc/lpc restart printer
Sun Release 3.2 — Last change: 23 September 1985