Add an IP printer with command line

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.