CUPS Notes

The Common Unix Printing System (CUPS)

The Common UNIX Printing System, or CUPS, is a comprehensive network based print system for Linux and other UNIX based operating system. CUPS supports printing to all Postscript based printers, and provides an interface to print to non Postscript printers.

Print Jobs

A print job is a document that is submitted for printing. When a user prints a document, the document gets formatted into a format that the printer understands. This formatted document becomes a print job, and is submitted to CUPS for processing. CUPS will handle the details of submitting the job to the physical printer. Each job is assigned a number, which can be used to reference the job with the command line tools.

Printers and Print Queues

Before CUPS can print, printer details must be configured. A single physical printer may be configured up on several different computers running CUPS (although typically it would only be configured on one computer) . The configuration specifies the printer type, how it is connected (i.e. locally or over the network), which driver to use, who can access it etc. The configuration also assigns a name to the configuration which is used to refer to the printer. The computer that contains the printer configuration information also allocates space for a print queue, which is used to store print jobs that are waiting to be sent to the printer.

Once a printer is configured on one computer, other computers on the network may use the configuration to send jobs to the printer.

How It Works

CUPS services are provided by the cupsd daemon, which must be running on any Linux box that wishes to print. The cupsd daemon handles all aspects of the print process including printer sharing, drivers, access control, and submitting print jobs to remote print queues.

Consider the diagram. It described a network that contains several printers. Let's examine how CUPS manages print jobs destined to the various printers on the network.

CUPS diagram

CUPS Features

Some of the features that CUPS supports are:

Printing

Print jobs can be submitted by applications, or via the command line. Most applications have a similar printing interface to that used by Microsoft Windows. Typically printing from an application is as simple as selecting Print from a menu.

Print jobs can be submitted and managed from the command line as well. The following commands are used for this purpose:

Submitting Print Jobs:

lp [options] file_name
Command to submit print jobs from the command line. The -d option specifies the printer name. If a printer name is not specified, CUPS will use the default printer. The -n num option specifies how many copies to print.

Print job control:

cancel job_id
Used to remove jobs from the queue. Replace job_id with the job id to cancel.

Setting The Default Printer

lpoptions -d printername
Sets printer options. The -d option specifies the printer name to be set as default.

CUPS also provides a comprehensive web based interface for printer configuration and management. The interface can be accessed by pointing your web browser to: http://localhost:631 or http://yourIP:631

More Information

For more information on CUPS, consult the official CUPS website at www.cups.org.