Joseph Zikusooka ~ Zik

A software engineer specializing in open source technologies | Very experienced in building and configuring UNIX/Linux systems and servers. Passionate about developing software applications and hardware for the smart home | Currently serving as the CEO of Jambula Labs and the project leader at JambulaTV, a smart home automation and entertainment platform - https://jambulatv.com | This blog focuses on the following areas: Linux How-Tos and Tutorials ::: IT Security News ::: Free and Libre Open Source Software ::: Smart Home Software ::: Digital Innovations in East Africa https://mastodon.social/@jzik | https://github.com/zikusooka

How to add a printer in Linux using the command line (CLI)

Managing printers in Linux has become easier lately. With just a few clicks in your GNOME, KDE, UNITY, or other desktop, you could be printing away in just seconds. But what about the command line Interface? Here too, a simple command is all you need, and in a few steps your printer should be setup

Before you start, ensure that the CUPS package is installed on your Linux system and if not, install it using your package manager e.g. For Redhat based systems:

dnf install cups

Alternatively, you may download CUPS and PPD files direct from the CUPS website at: https//www.cups.org/

1. Find the Postscript Printer Description (PPD) file for your printer. Typically installed with the cups package and stored under: /usr/share/cups/model/. Also look under /usr/share/ppd/cupsfilters

2. Run the command lpinfo -l to get a list of available printers and drivers i.e. device-uri

3. Add your printer using the following command:

lpadmin -p “HP-LaserJet-CM3530-1” -D “Human Resources Department” -P /usr/share/ppd/cupsfilters/HP-Color_LaserJet_CM3530_MFP-PDF.ppd -E -v file:///dev/PRINTER_PATH

-v represents the device-uri as seen in step 3. For a detailed explanation of the options, type: man lpadmin

How to add a printer in Linux using the command line (CLI)

Leave a Reply

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

Scroll to top