Common Unix Printing System

From Christoph's Personal Wiki
Jump to: navigation, search

The Common Unix Printing System (CUPS) is a modular printing system for Unix-like computer operating systems that allows a computer to act as a powerful print server. A computer running CUPS is a host which can accept print jobs from client computers, process them, and send them to the appropriate printer.

PostScript Printer Description (PPD)

PostScript Printer Description (PPD) files are created by vendors to describe the entire set of features and capabilities available for their PostScript printers. For example, a generic PPD file for all models of HP Color LaserJet contains:

*% =================================
*% Basic Device Capabilities
*% =================================
*LanguageLevel:        "2"
*ColorDevice:          True
*DefaultColorSpace:    CMYK
*TTRasterizer:         Type42
*FileSystem:           False
*Throughput:           "10"

MIME databases

During start-up, the CUPS daemon loads two MIME databases: mime.types that defines the known file types that CUPS can accept data for, and mime.convs that defines the programs that process each particular MIME type.[1]

The mime.types file has the syntax:

mimetype      { [file-extensions] | [pattern-match] }

For example, to detect an HTML file, the following entry would be applicable:

text/html       html htm \
printable(0,1024) + (string(0,"<HTML>") string(0,"<!DOCTYPE"))

The mime.convs file has the syntax:

source destination cost program

Some examples:

text/plain application/postscript 50 texttops
application/vnd.cups-postscript application/vnd.cups-raster 50 pstoraster
image/* application/vnd.cups-postscript 50 imagetops
image/* application/vnd.cups-raster 50 imagetoraster

User Interface tools

There are several tools created to help set up CUPS. The CUPS server itself runs a webserver administration interface on port 631.[2]


System V

the user command to print
shows the current print queue
deletes a job from the print queue
a sysadmin command that configures the print system
a sysadmin command that moves jobs between queues


Assign a job to a queue.
Display the jobs assigned to a queue and their print status.
Remove a job from a queue.
Control a queue.

Network configuration scripts

If you are using a network computer, you will need to add your IP address to the printer's address pool. Create a ifcfg file (usually in /etc/sysconfig/network-scripts) and call it something like ifcfg-eth0:0). Then add the following lines (replacing the IP address, etc.):


You will also need to add your URI (i.e. printer IP address) to your /etc/cups/printers.conf file. As an example:

# Printer configuration file for CUPS v1.2.4
<Printer MyPrinter>
Info The_Name_of_Your_Printer
DeviceURI ipp://192.168.xx.1/ipp
State Idle
StateTime 1162501383
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job

Note: If you only want to use a specific printer among many available ones on your network, it would be best (and faster) to turning "Browsing Off" in your /etc/cups/cupsd.conf file.

Of course, make sure you have your printer's PPD file in /etc/cups/ppd/


/etc/init.d/network restart

Now you can check the status of your printer with:

lpstat -l -p -v

See also



  1. Easy Software Products. CUPS Software Administrators Manual, File Typing and Filtering. (accessed 2007-01-09).
  2. CUPS Software Administrators Manual, "Managing Printers from the Web"

External links

Related links

  • OpenPrinting — resources to help with printing under free operating systems like Linux