Use the lpstat command to determine the status of the LP print service. You can check the status of your own jobs in the print queue, determine which printers you can use, or determine request ids of your jobs if you want to cancel them.
Type the following command to find out the status of your print requests.
$ lpstat |
A list of the files that you have submitted for printing is displayed.
In the following example, one file is queued for printing to the printer jetprint.
$ lpstat jetprint-1 user2 11466 Nov 01 15:10 on jetprint $ |
The lpstat command displays one line for each print job, showing the request id, followed by the user who spooled the request, the output size in bytes, and the date and time of the request.
To find out which printers are configured on your system, type the following command.
$ lpstat -s |
The status of the scheduler is displayed, followed by the default destination and a list of the systems and printers you can use.
In the following example, the scheduler is running, the default printer is jetprint, and the print server for the jetprint and fastprint printers is prtsrv1.
$ lpstat -s scheduler is running system default destination: jetprint system for jetprint: prtsrv1 system for fastprint: prtsrv1 $ |
The -t option for lpstat gives you a complete listing of the status of the LP print service.
To display a complete listing of all status information, type the following command.
$ lpstat -t |
The system displays all available status information.
In the following example, no jobs are in the print queue. When files are spooled for printing, the status of those print requests is also displayed.
You can use the -p to the lpstat command to request printer status information for individual printers. This option shows whether the printer is active or idle, when the printer was enabled or disabled, and whether the printer is available to accept print requests.
To request status for all printers on a system, type the following command.
$ lpstat -p |
In the following example, two printers are idle, enabled, and available.
$ lpstat -p printer jetprint is idle. enabled since Wed Nov 1 15:09:28 MST 2000. available. printer fastprint is idle. enabled since Wed Nov 1 15:09:46 MST 2000. available. $ |
If one of those printers had jobs in the print queue, those jobs would also be displayed.
To request status for an individual printer by name, type the following command.
$ lpstat -p printername |
In this example, printername is the name of the specific printer.
You can use the lpstat command to request different types of printing status information. Table 8–2 summarizes the frequently used options for the lpstat command. Use these options individually, or combine them in any order on the command line. When you combine options, use a space between each option and repeat the dash (-).
Table 8–2 Summary of Frequently Used lpstat Options
Option |
Description |
---|---|
Accept. Show whether print destinations are accepting requests. |
|
Class. Show classes and their members. |
|
Destination. Show default destination. |
|
Forms. Show forms. |
|
Output. Show status of print requests. |
|
Printer/Description/Long list. Show status of printers. |
|
Request. Request scheduler status. |
|
Show position of job in the queue. |
|
Status. Show status summary. |
|
Sets. Show character sets. |
|
User. Show requests by user. |
|
Show devices. |
See the lpstat(1) man page for a complete list of options.