lpq(1)
Name
lpq − spool queue examination program
Syntax
lpq [ options ] [ job #... ] [ user... ]
Description
The lpq command examines the spooling area used by lpd for printing files on the printer, and reports the status of jobs. The lpq command invoked without any arguments reports on any jobs currently in the default queue.
When jobs are being printed, lpq reports the queue as being “active”. For each job submitted, lpq reports the user’s name, current rank in the queue, the names of files comprising the job, the job identifier and the total size in bytes. The job identifier is a number which may be supplied to lprm to remove a specific job.
Job ordering is determined by the FIFO (First In, First Out) algorithm used to scan the spooling directory. When the queue is empty, lpq reports that there are “no entries”.
File names may be unavailable for some jobs, for example, if the lpr command is used without specifying a file name, or if lpr is used in a pipe line. If file names are unavailable, the file name reported by lpq is “standard input”.
Arguments
job #... Causes lpq to report on only the job number(s) specified.
user... Causes lpq to report on only the jobs for the specified user(s).
Options
+nScan and display the spool queue until the queue is empty. The queue is scanned every n seconds, if no argument is specified the queue is scanned every 30 seconds.
−lDisplay the status of each job on more than one line if necessary. If this option is not used, the status of each job is displayed on one line.
−Pprinter
Report the status of the spool queue for the printer specified. If this option is not used, the spool queue displayed is the one defined by the PRINTER environment variable. If a queue is not defined by the PRINTER environment variable, the spool queue displayed is for the printer named “lp” in the printcap file.
Restrictions
The displayed status of the spool queue may not always be the current status. This is because jobs may be completed after the queue has been examined, but before the status has been displayed.
Error Messages
Two of the most common error messages from lpq are:
Warning: no daemon present
A daemon is not available for the specified printer. Refer to the lpc(8) command to find out how to restart the printer daemon.
unknown printer
The printer specified as an argument to the −P option, doesn’t have an entry in the /etc/printcap file.
Files
/etc/termcap For 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