I needed to add a Konica Minolta BizHub 363 multifunction device as a printer on my MacBook Pro laptop, since the default printer was inaccessible today. So I checked if there was a printer driver for it already on the laptop in
/Library/Printers/PPDs/Contents/Resources. I saw one there, so added it from a Terminal window, i.e., a shell prompt.
$ ls -l /Library/Printers/PPDs/Contents/Resources | grep -i Konica | grep 363 -rw-r--r-- 1 root wheel 42781 Sep 3 2012 KONICAMINOLTA363.gz $ lpadmin -p "192.168.233.8" -v "lpd://192.168.233.8" -D "Konica Minolta BizHub 363 MFD" -L "Building 14 Room E171" -P "/Library/Printers/PPDs/Contents/Resources/KONICAMINOLTA363.gz" -E
When adding a printer from the command line on an OS X system, you
can specify the IP address of the printer with the
(lowercase "p") argument to the
lpadmin command. Other
arguments for the command include the following:
-v "device-uri" Sets the device-uri attribute of the printer queue. Use the -v option with the lpinfo(8) command to get a list of supported device URIs and schemes. -D "info" Provides a textual description of the destination. -L "location" Provides a textual location of the destination. -P ppd-file Specifies a PostScript Printer Description file to use with the printer. If specified, this option overrides the -i option (interface script).
The text enclosed in quotes after the
-D can be any
description you want to give to the printer and the
any text you wish to use to indicate the location of the printer.
-P (uppercase "P") option, I referenced the
Konica Minolta BizHub 363
PostScript Printer Description file I saw on the system.
After you've added a printer, you can verify that it has been added
lpstat command. E.g.,
lptstat -p -d
shows all of the printers added to the system and the default printer for
-d Shows the current default destination. -h server[:port] Specifies an alternate server. -l Shows a long listing of printers, classes, or jobs. -o [destination(s)] Shows the jobs queue on the specified destinations. If no destina- tions are specified all jobs are shown. -p [printer(s)] Shows the printers and whether or not they are enabled for print- ing. If no printers are specified then all printers are listed.
E.g., I can see that the printer I added is enabled. I can also see that the default printer is at 192.168.234.59, which was inaccessible to me today because the room it is in was locked.
$ lpstat -p -d printer 192.168.233.8 is idle. enabled since Thu Apr 16 14:12:21 2015 printer 192.168.234.59 is idle. enabled since Thu Apr 16 13:59:17 2015 Data file sent successfully. printer _192_168_232_14 disabled since Wed Aug 17 14:52:55 2011 - /usr/libexec/cups/backend/lpd failed printer _192_168_235_214 disabled since Tue Dec 27 09:55:45 2011 - Printer not responding! printer _192_168_75_20 is idle. enabled since Sat Jun 29 10:21:21 2013 system default destination: 192.168.234.59
Adding a printer from the command line on an OS X system
Date: August 7, 2014