Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
8.  Using Printers Determining Printer Status Checking on the Status of Your Print Requests  Previous   Contents   Next 
   
 

Checking Available Printers

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
$

Displaying All Status Information

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.

$ lpstat -t
scheduler is running
system default destination: jetprint
system for jetprint: prtsrv1
system for fastprint: prtsrv1

jetprint accepting requests since Wed Nov  1 15:09:29 MST 2000
fastprint accepting requests since Wed Nov  1 15:09:47 MST 2000
printer fastprint is idle. enabled since Wed Nov  1 15:09:46 MST 2000. 
jetprint-1              user2            11466   Nov 01 15:10 on jetprint
$

Displaying Status for Printers

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.

Summary Table of lpstat Options

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

-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 print requests.

-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.

Canceling a Print Request

Use the cancel command to cancel a print request while it is in the queue or while it is printing. To cancel a request, you need to know the print request id. The request id always includes the name of the printer, a dash, and the number of the print request. When you submit the print request, the request id is displayed. If you do not remember your request id, type lpstat -o and press Return. Only the user who submitted the request, or someone logged in as root or lp can cancel a print request.

Canceling a Print Request by ID Number

To cancel a print request, type the following command.

$ cancel request_id

In the previous example, request_id is the request id number of the desired print request.

A message informs you that the request is cancelled. The next job in the queue begins printing.

In the following example two print requests are canceled.

$ cancel jetprint-6 fastprint-5
jetprint-6: cancelled
fastprint-5: cancelled
$

Canceling a Print Request by Printer Name

You can also cancel just the job that is currently printing (if you submitted it) by typing the printer name in place of the request id.

$ cancel printername

In the previous example, printername is the name of the printer to which you sent the request.

A message informs you that the request is canceled. The next job in the queue begins printing

In the following example, the current print request has been canceled.

$ cancel jetprint
jetprint7: cancelled
$

Your system administrator can log in as root or lp and cancel the currently printing request by using the printer name as the argument for the cancel command.

 
 
 
  Previous   Contents   Next