lpq(1) — Commands
OSF
NAME
lpq − Spool queue examination program
SYNOPSIS
lpq [+][number] [-l] [-Pprinter] [request_ID ... ] [user ... ]
The lpq command examines the spooling area used by lpd for printing files on the line printer, and reports the status of the specified requests or all requests associated with a user.
FLAGS
-lDisplays information about each of the files comprising the printer request.
-Pprinter
Specifying printer displays requests queued for that printer only.
+[number]
Displays the spool queue until it empties. Sleeps number seconds between scans of the queue if number is specified.
DESCRIPTION
The lpq command invoked without any arguments reports on any requests currently in the queue. The -P flag may be used to specify a particular printer; otherwise, the default line printer is used (or the value of the PRINTER environment variable).
Specifying one or more request_IDs displays only the specified requests. Specifying one or more users displays print requests from those users only.
If you specify the + argument, lpq displays the spool queue until it empties. Supplying a number immediately after the + argument indicates that lpq should sleep number seconds in between scans of the queue. All other arguments supplied are interpreted as user or request_ID arguments to filter out only those requests of interest.
For each request submitted (that is, each request invoked by lp or lpr) lpq reports the user’s name, current rank in the queue, the names of files comprising the request, the request ID (a number which you can use to identify the request to other commands, such as lprm) and the total size in bytes.
The -l flag causes information about each of the files comprising the request to be printed; without it, only as much information as will fit on one line is displayed. Job ordering depends on the algorithm used to scan the spooling directory and is supposed to be FIFO (First In First Out). Filenames comprising a request may be unavailable (when lp or lpr is used as a sink in a pipeline) in which case the file is indicated as follows:
standard input
Japanese Language Support
If Japanese Language Support is enabled on your system, this command is not available.
EXAMPLES
To display a request in the print queue, enter:
lpq -Pprinter1
This command displays a list similar to the following:
Mon March 2 15:15:15 1990: printer1 is ready and printing
RankPriOwnerJobFilesTotal Size
active 0rcb888massachusetts1024 bytes
1st 0jmp110berkshire2048 bytes
(Output may be formatted differently on your system.)
FILES
/etc/termcapManipulates the screen for repeated display.
/etc/printcapPrinter description file.
/var/spool/∗Spool directories.
/var/spool/∗/cf∗Daemon control files.
/var/spool/∗/df∗Data files specified in cf files.
/var/spool/∗/tf∗Temporary copies of cf files.
/var/spool/∗/lockLock file used to obtain the process ID of the current daemon and the request ID of the currently active request.
NOTES
Due to the dynamic nature of the information in the spooling directory, lpq may report unreliably. Output formatting is sensitive to the line length of the terminal; this can result in widely spaced columns.
DIAGNOSTICS
Appropriate diagnostic messages appear under several conditions:
•If there is no daemon active, but there are files in the spooling directory, the message Warning: no daemon present is displayed.
•If the network is unreachable, the message connection to device is down is displayed.
•If the printcap file is unavailable, the message lpq: device: cannot open printer description file is displayed.
•If the spooling directory is unavailable, the message lpq: device: cannot chdir to spooling directory is displayed.
An appropriate message is displayed if the lock file is malformed.
RELATED INFORMATION
Commands: lp(1)/cancel(1), lpc(8), lpd(8), lpr(1), lprm(1), lpstat(1).