Previous Table of Contents Next


Printing to a Printer by Name

Whether or not a default printer has been designated for your system, you can submit print requests to any printer that is configured for your system. To submit a print request to an individual printer, typelp -d printer-name file-name and press Return. The file specified is placed in the print queue of the destination printer, and the request ID is displayed.

The following example will print the /etc/passwd file on the printer acorn:

pine% lp -d acorn /etc/passwd
request id is acorn-9 (1 file)
pine%

If you submit a request to a printer that is not configured on your system, an information message is displayed, as shown in this example:

pine% lp -d thorn /etc/passwd
UX:lp: ERROR: Destination "thorn" is unknown to the
              LP print service.
pine%

Requesting Notification When a File Is Done Printing

When you submit a large file to be printed, you may want the LP print service to notify you when printing is complete. You can request that the LP print service notify you either via an e-mail message or via a message to your console window.

To request e-mail notification, use the -m option when you submit the print request. Type lp -m file-name and press Return.

To request that a message be written to your console window, use the -w option when you submit the print request. Type lp -w file-name and press Return.

Printing Multiple Copies

You can print more than one copy of a file. When you request more than one copy, the file is printed the number of times you specify by using the -n option to the lp command. The print request is considered as one print job, and only one header page is printed. To request multiple copies, type lp -nnumber file-name and press Return.

The following example will print four copies of the /etc /passwd file:

pine% lp -n4 /etc/passwd
request id is pinecone-9 (1 file)
pine%

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.

The Status of Your Print Requests

To find out the status of your own spooled print requests, type lpstat and press Return. A list of the files that you have submitted for printing is displayed.

In this example, on the system pine, one file is queued for printing to the printer pinecone:

pine% lpstat
pinecone-1Ø            fred          1261   Mar 12 17:34 on pine
pine%

The lpstat command displays one line for each print job, showing the request ID and followed by the user who spooled the request, the output size in bytes, and the date and time of the request.

Availability of Printers

To find out which printers are configured on your system, type lpstat -s and press Return. 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 this example, on the system elm, the scheduler is running, the default printer is pinecone, and two network printers are available:

elm% lpstat -s
scheduler is running
system default destination: pinecone
system for pinecone: pine
system for acorn: oak
elm%

Display of 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 lpstat -t and press Return. All available status information is displayed.


Previous Table of Contents Next