Use the lpstat command to find out about the status of the LP print service. You can check on the status of your own jobs in the print queue, determine which printers are available for you to use, or determine request ids of your jobs if you want to cancel them.
Enter the following to find out the status of your own spooled print requests:
$ lpstat |
A list of the files that you have submitted for printing is displayed.
In the following example, on the system pine, one file is queued for printing to the printer pinecone:
$ lpstat pinecone-10 fred 1261 Mar 12 17:34 on pine $ |
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:
$ lpstat -s |
The status of the scheduler is displayed followed by the default destination and a list of the systems and printers that are available to you.
In the following example, on the system elm, the scheduler is running, the default printer is pinecone, and two network printers, pinecone and acorn, are available:
$ lpstat -s scheduler is running system default destination: pinecone system for pinecone: pine system for acorn: oak $ |
The -t option for lpstat gives you a short listing of the status of the LP print service.
To display a short listing of all status information, type the following:
$ lpstat -t |
All available status information is displayed.
In the following example, there are no jobs in the print queue. When files are spooled for printing, the status of those print requests is also displayed:
You can request printer status information for individual printers using the -p option to lpstat. This option shows whether the printer is active or idle, when it was enabled or disabled, and whether it is available to accept print requests.
To request status for all printers on a system, type the following:
$ lpstat -p |
In the following example, two printers are idle, enabled, and available. If one of those printers had jobs in the print queue, those jobs would also be displayed.
$ lpstat -p printer pinecone is idle. enabled since Wed Jan 2 18:20:22 PST 1991. available. printer acorn is idle. enabled since Mon Mar 4 15:53:44 PST 1991. available. $ |
To request status for an individual printer by name, type the following:
$ lpstat -p printername |
where printername is the name of the specific printer.
If you want to see all of the characteristics for a printer, use the -p option together with the -l (long) option to lpstat. This command can be especially useful for finding the printer type and content type.
To show characteristics for all printers on a system, enter the following:
$ lpstat -p -l |
A table shows all the configuration information that is used by the LP print service for each printer.
In the following example, all of the fields are blank except for the content type and the printer type of the printer pinecone.
You can request different types of printing status information using the lpstat command. Table 8-2summarizes 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 (-).
For example, to show a long list of status for an individual printer, you would enter the following:
$ lpstat -p printername -l |
where printername is the name of the printer for which you want to view status.
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 output. |
|
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.