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

About Vinh Nguyen

Statistician

1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>