[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Commands Reference, Volume 3

lpstat Command

Purpose

Displays line printer status information.

Syntax

lpstat [ -aList ] [ -cList ] [ -d ] [ -oList ] [ -pList ] [ -r ] [ -s ] [ -t ] [ -uList ] [ -vList ] [ -W ]

Description

The lpstat command displays information about the current status of the line printer.

If no flags are given, lpstat prints the status of all requests made by the lp command.

Flags can appear in any order and can be repeated. Some flags take an optional list as a parameter. Enter the list as either a list of items separated by commas, as in lpstat -aQueue1,Queue2, or as a list of items enclosed in single or double quotes and separated either by commas or one or more spaces, as in, for example, lpstat -a"Queue1 Queue2" or lpstat -a"Queue1,Queue2" or lpstat -a'Queue1 Queue2' or lpstat -a'Queue1,Queue2'.

If you specify a flag with no parameters, all information pertaining to that flag is printed.

The display generated by the lpstat 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 contains the client's local queue name followed by the remote queue name. The spooling subsystem first displays remote print requests on the local queue. When the remote machine begins to process the remote print job, the status display for the print job moves to the remote queue.

When a status command communicates with a remote host, the display occasionally appears to hang while the command waits for a response from the remote machine. The command eventually times out if no connection is established between the two machines.

Flags

-aList Provides status and job information on queues. Specifying the lpstat command with this flag is the same as specifying the enq -q -PQueue1 -PQueue2 ... command (where Queue1, Queue2, etc., are items in List).
-cList Provides status and job information on queues. Specifying the lpstat command with this flag is the same as specifying the enq -q -PQueue1 -PQueue2 ... command (where Queue1, Queue2, etc., are items in List).
-d Prints the status information for the system default destination for the lp command. Specifying the lpstat command with this flag is the same as specifying the enq -q command.
-oList Prints the status of print requests or print queues. List is a list of intermixed printer names and job numbers.
-pList Prints the status of printers.
-r Provides status and job information on queues. Specifying the lpstat command with this flag is the same as specifying the enq -A command.
-s Displays a status summary, including a list of printers and their associated devices. Specifying the lpstat command with this flag is the same as specifying the enq -A command.
-t Displays all status information, including a list of printers and their associated devices. Specifying the lpstat command with this flag is the same as specifying the enq -AL command.
-uList Prints the status of all print requests for users specified in List. List is a list of login names. Specifying the lpstat command with this flag is the same as specifying the enq -u UserName command.
-vList Prints the status of printers. The List variable is a list of printer names.
-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 -t flag. If the -t flag and the -W flag are used simultaneously, the first one specified takes precedence.

Exit Status

This command returns the following exit values:

0 Successful completion.
>0 An error occurred.

Examples

  1. To display the status for all print queues, enter:
    lpstat
  2. To display the long status for all printers, enter:
    lpstat -t
  3. To display a job number in the print queue lp0, enter:
    lpstat -plp0
    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
  4. To display the status for users root, ghandi, and king, enter:
    lpstat -u"root,ghandi,king"
  5. To display the status of all print queues in wide format for AIX Version 4.3.2 or later, enter:
    lpstat -W

Files

/var/spool/lpd/* Contains temporary copies of remote enqueued files.

Related Information

The disable command, enable command, enq command, lp command, lpr command, qchk command.

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

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

Queuing System Overview for System Management in AIX Version 4.3 System Management Guide: Operating System and Devices.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]