Terminal MacOS – How to Add an IP Printer Using the Command Line

macosprintingterminal

In Printer and Scanner settings, i click on plus sign, select IP and fill the following:

  • Address: 10.242.1.xx:80
  • Protocol: IPP
  • Queue: ipp/2299xxxxx9342/xxxxxxx
  • Name: PRINTER-1

I searched on Google but did not give any useful infomation about it
How can i add IP printer in command line?

Best Answer

You can use lpadmin

lpadmin -E -p "PrinterName" -v "PrinterURL" -P "PPD" -o printer-is-shared=false

  • -E Enables the printer

  • "PrinterName" can be anything that describes your printer

  • "PrinterURL" is the URL or IP address of the printer

  • -P "PPD" is the PPD file you wish to use (including the path)

  • -o printer-is-shared=false turns off printer sharing

The PPD files are usually located in the /etc/cups/ppd directory. If the printer you want to use is not listed, you can download the PPD from the OpenPrinting site.