display print queue status (UNIX)
Syntax:
lpq [-l] [-P name] [-q] [-s seconds] [jobnumber...]
[user...]
Options:
- -l
- ("el") Loop. After displaying the queue, sleep for a period of
time (default is 5 seconds), then redisplay the queue.
- -P name
- Use the named spooler and/or queue. If name begins
with a slash, it is assumed to be a full name, where the last
component is the name of a spool queue and the prefix is the name of
the spooler (/spooler/queue).
If name does not begin with
a slash, it is assumed to be a queue name.
If a server is not specified, the utility will use the spooler
identified in the LPSRVR environment variable, or
/qnx/spooler if LPSRVR is not set.
If a queue is not specified, lp will use the queue
identified in the LPDEST environment variable, or the
first queue defined in the setup file of the spooler being used if
LPDEST is not set.
For more detailed discussion, see Ch.9, "Print Spooling,"
in the QNX Installation & Configuration manual.
- -q
- Print a list of the available printers.
- -s seconds
- When looping, sleep for seconds rather than the
default. Setting this value automatically sets looping mode.
- jobnumber
user - Specifying either of these causes lpq to filter
out only those jobs of interest.
Examples:
Display all current print jobs submitted by steve:
lpq steve
Description:
The lpq utility reports on the status of jobs in a printer
queue.
For each job, lpq reports the user's name, the job identifier,
the ranking in the queue, and the names of files that make up the
job.
If no filename is available, the name will be displayed as standard
input.
When lpq is set for "looping," it will continue
to redisplay the entries until no entries are left to display.
Exit status:
- 0
- Jobs of interest were discovered.
- 1
- No jobs of interest were discovered.
- >1
- An error occurred.
Environment variables:
- LPSRVR
- Use this spool server by default. (Will use /qnx/spooler if not set.)
- LPDEST
- Use this spool queue by default. (Will use first queue entry in the setup
file of the located spooler if not set.)
- PRINTER
- Historical alternative to LPDEST. Ignored if
LPDEST is set.
See also:
- lp utility (Send files to a printer)
- lpc utility (Line printer control)
- lprm utility (Remove jobs from printer queue)
- lpsrvr manager (Print server)
- QNX Installation & Configuration
Caveats:
Since lpq is based on polling, it's possible that very
fast jobs will completely escape its notice.