The lpstat command includes information for the AIX® Print Subsystem lpstat and the System V Print Subsystem lpstat.
AIX Print Subsystem lpstat Command
Displays line printer status information.
lpstat [ -aList ] [ -cList ] [ -d ] [ -oList ] [ -pList ] [ -r ] [ -s ] [ -t ] [ -uList ] [ -vList ] [ -W ]
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.
Item | Description |
---|---|
-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 the status information with longer
queue names, device names, and job numbers. Longer job number information
is supported in AIX 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 specified
flag takes precedence. If the -W flag and -l flag are used simultaneously, the result displays the long status of the print job in the semicolon-separated format. |
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
lpstat
lpstat -t
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
lpstat -u"root,ghandi,king"
lpstat -W
Item | Description |
---|---|
/var/spool/lpd/* | Contains temporary copies of remote enqueued files. |
The disable command, enable command, enq command, lp command, lpr command, qchk command.
Command for checking print job status (qchk command) in AIX Version 7.1 Operating system and device management.
Printers, print jobs, and queues in AIX Version 7.1 Operating system and device management.
Print spooler in AIX Version 7.1 Operating system and device management.
System V Print Subsystem lpstat Command
Prints information about the status of the LP print service.
lpstat [flags] [request-ID-list]
The lpstat command displays information about the current status of the LP print service. If no flags are given, lpstat displays the status of all print requests made by you. (See lp for more information.)
The command lpstat -o printername is used to list all the requests queued on the specified printer. If printername points to a remote printer (see lpadmin), then lpstat -o printername lists all the requests on the remote printer, not just those submitted locally.
Any arguments that are not flags are assumed to be request-IDs as returned by lp. The lpstat command displays the status of such requests. The flags may appear in any order and may be repeated and intermixed with other arguments. Some of the keyletters below may be followed by an optional list that can be in one of two forms:
Specifying all after any keyletter that takes list as an argument causes all information relevant to the keyletter to be displayed. For example, the command lpstat -a all lists the accepting status of all print destinations.
The omission of a list following such keyletters causes all information relevant to the keyletter to be displayed. For example, the command lpstat -a is equivalent to lpstat -a all.
There are two exceptions to the behavior of the all keyword. The first is when it is used in conjunction with the -o flag: lpstat -o all only lists requests submitted locally to remote printers. The second is when it is used with directory-enabled print queues. Use of the all keyword will only return non-directory-enabled print queues. lpstat -a list will report whether the both directory-enabled and non-directory-enabled print queues in list are accepting requests. For the -a and -b flags, lpsched will remember the directory-enabled print queues specified until it is restarted. Subsequent calls to lpstat -a and lpstat -p will report the status of all non-directory-enabled print queues as well as the directory-enabled print queues previously specified. Once lpsched has been restarted, the use of the all keyword with the lpstat command will once again only display non-directory-enabled print queues. The dslpsearch command should be used to search for defined directory-enabled print queues.
If you enter lpstat -?, the system displays the command usage message and returns 0.
In order to maintain system security access information, the information needed to produce the printer status given by lpstat -p is available only if the LP scheduler is running.