[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

lpq Command

Purpose

Examines the spool queue.

Syntax

lpq [ + [ Number ] ] [ -l | -W ] [-P Printer ] [ JobNumber ] [ UserName ]

Description

The lpq command reports the status of the specified job or all jobs associated with the specified UserName and JobNumber variables. JobNumber variable specifies the number of the job in the spool queue that you want to view. A UserName variable specifies viewing the jobs for the name of the person who submitted the job to that queue.

The lpq command reports on any jobs currently in the default queue when invoked without any options. Parameters supplied that are not recognized as parameters are interpreted as user names or job numbers to filter out only those jobs of interest.

For each job submitted (each job called by the lpr command), the lpq command reports the user's name, current rank in the queue, the name of the job, the job identifier (a number that can be supplied to the lprm command for removing a specific job), and the total size in blocks. Normally, 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). File names making up a job may be unavailable (when the lpr command is used as a sink in a pipeline). In this case, the file is indicated as - (standard input).

The display generated by the lpq command contains two entries for remote queues. The first entry contains the client's local queue and local device name and its status information. The second entry follows immediately; it contains the client's local queue name (again), followed by the remote queue name. Any jobs submitted to a remote queue are displayed first on the local side and are moved to the remote device as the job is processed on the remote machine.

Since the status commands communicate with remote machines, the status display may occasionally appear to hang while waiting for a response from the remote machine. The command will eventually time out if a connection cannot be established between the two machines.

Flags

-l Generates the long output format.
+ [ Number ] Displays the spool queue until it empties. A Number variable is the time in seconds before the display regenerates.
-P Printer Displays the spool queue for the printer specified by the Printer variable.
Note: Any destination command line options override both the LPDEST and the PRINTER environment variables.
-W Displays a wide version of status information with longer queue names, device names, and job numbers. Longer job number information is available on AIX Version 4.3.2 and later. This flag cannot be used with the -l flag. If the -l flag and the -W flag are used simultaneously, the first one specified takes precedence.

Examples

  1. To display a job number in the print queue lp0, enter:
    lpq -P lp0

    This command displays a list similar to the following:

    Queue    Dev      Status    Job    Files    User      PP    %      Blks    CP    Rnk
    lp0       dlp0    running   39      motd     guest    10    83      12      1     1
  2. To display the status of the defeult queue in wide format for AIX Version 4.3.2 or later, enter:
    lpq -W

Files

/usr/bin/lpq Contains the lpq command.
/usr/sbin/qdaemon Contains the queuing daemon.
/etc/qconfig Contains the queue configuration file.
/etc/qconfig.bin Contains the digested, binary version of the /etc/qconfig file.
/var/spool/lpd/qdir/* Contains queue requests.
/var/spool/lpd/stat/* Contains information on the status of the devices.
/var/spool/qdaemon/* Contains temporary copies of enqueued files.

Related Information

The lpr command, lprm command, lpstat command, qchk command.

The qconfig file.

Checking Print Job Status in AIX Version 4.3 System User's Guide: Operating System and Devices.

Printers, Print Jobs, and Queues in AIX Version 4.3 System User's Guide: Operating System and Devices.

Spooler Overview for System Management in the AIX Version 4.3 Guide to Printers and Printing.


[ Previous | Next | Contents | Glossary | Home | Search ]