{"id":2000,"date":"2020-02-04T13:28:40","date_gmt":"2020-02-04T10:28:40","guid":{"rendered":"https:\/\/joseph.zikusooka.com\/?p=2000"},"modified":"2020-02-04T13:36:59","modified_gmt":"2020-02-04T10:36:59","slug":"how-to-add-a-printer-in-linux-using-the-command-line-cli","status":"publish","type":"post","link":"https:\/\/joseph.zikusooka.com\/?p=2000","title":{"rendered":"How to add a printer in Linux using the command line (CLI)"},"content":{"rendered":"\n<p>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<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong>dnf install cups<\/strong><br><br>Alternatively, you may download CUPS and PPD files direct from the CUPS website at: <a href=\"https:\/\/www.cups.org\/\">https\/\/www.cups.org\/<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>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<\/p>\n\n\n\n<p>2. Run the command lpinfo -l to get a list of available printers and drivers i.e. device-uri<\/p>\n\n\n\n<p>3. Add your printer using the following command:<\/p>\n\n\n\n<p><strong>lpadmin -p &#8220;HP-LaserJet-CM3530-1&#8221; -D &#8220;Human Resources Department&#8221; -P \/usr\/share\/ppd\/cupsfilters\/HP-Color_LaserJet_CM3530_MFP-PDF.ppd -E -v file:\/\/\/dev\/PRINTER_PATH<\/strong><\/p>\n\n\n\n<p>-v represents the device-uri as seen in step 3. For a detailed explanation of the options, type: man lpadmin<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2001,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/posts\/2000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2000"}],"version-history":[{"count":4,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/posts\/2000\/revisions"}],"predecessor-version":[{"id":2005,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/posts\/2000\/revisions\/2005"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=\/wp\/v2\/media\/2001"}],"wp:attachment":[{"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joseph.zikusooka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}