OpenWindows Advanced User's Guide

8.2 Determining Printer Status

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.

8.2.1 Checking on the Status of Your Print Requests

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.

8.2.2 Checking on Available Printers

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
$

8.2.3 Displaying All Status Information

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:

$ lpstat -t
scheduler is running
system default destination: pinecone
system for acorn: oak
pinecone accepting requests since Wed Jan 2 18:20:10 PST 1991
acorn accepting requests since Mon Mar 4 15:53:47 PST 1991
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.
$

8.2.4 Displaying Status for Printers

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.

8.2.5 Displaying Printer Characteristics

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.

$ lpstat -p pinecone -l
printer pinecone is idle. enabled since Wed Jan 2 18:20:22 PST
1991. available.
        Content types: PS
        Printer types: PS
        Description:
        Users allowed:
                (all)
        Forms allowed:
                (none)
        Banner not required
        Character sets:
                (none)
        Default pitch:
        Default page size:
$   

8.2.6 Summary Table of lpstat Options

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 

-a

Accept. Show whether print destinations are accepting requests. 

-c

Class. Show classes and their members. 

-d

Destination. Show default destination. 

-f

Forms. Show forms. 

-o

Output. Show status of output. 

-p [list][-D][-l}

Printer/Description/Long list. Show status of printers. 

-r

Request. Request scheduler status. 

-R

Show position of job in the queue 

-s

Status. Show status summary 

-S

Sets. Show character sets 

-u [username]

User. Show requests by user 

-v

Show devices 

See the lpstat(1)man page for a complete list of options.