Super Nerdy Cool

My (technical) adventures through the professional world…
May 12, 2011

Add a printer on the command line – cups-pdf example

Suppose you need to add a printer to a computer on the command line, e.g., a server that you access via a terminal. This post outlines how to use some basic commands from the CUPS system. I will illustrate with commands for a network-connected printer and cups-pdf for printing to PDF files (~/PDF/):

 <pre class="src src-sh">sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd

sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /path/to/ppd ## can also use usb:/

The -E flag is crucial (Enables the printer). If a web browser is accessible from the system, you can also go to http://localhost:631 to add printers via the web browser. Almost as easy as adding it via the system-config-printer command on Ubuntu.

To check currently installed printers:

 <pre class="src src-sh">lpstat -t

1 Comment to “Add a printer on the command line – cups-pdf example”

Leave a Comment