OSX: practical command line for printer Installation

Source: Internet
Author: User

In fact, it is very easy to use the lpadmin command. An example is given below:

printername="YOUR_PRINTER_NAME"location="LOCATION INFO"gui_display_name="HP Color LaserJet M600 in Office for Example"address="ipp://printserver.yourcompany.org/YOUR_PRINTER_NAME"driver_ppd="/Library/Printers/PPDs/Contents/Resources/hp color LaserJet M600.gz"# Populate these options if you want to set specific options for the printer. E.g. duplexing installed, etc.option_1=""option_2=""option_3=""# Now we can install the printer./usr/sbin/lpadmin \        -p "$printername" \        -L "$location" \        -D "$gui_display_name" \        -v "$address" \        -P "$driver_ppd" \        -o "$option_1" \        -o "$option_2" \        -o "$option_3" \        -o printer-is-shared=false \        -E
Description of the parameters:

Printername: When the printer is generated, CUPS is used as the file name of the printer.

Location: the physical location of the printer, such as the Financial Office or front-end printer. This information is optional.

Gui_displayname: printer name displayed in GUI

Address: CUPS supports multiple Protocol formats, such as lpd, ipp, dnssd, smb, http, Socket, and mdns. The specific situation depends on the specific network environment. If you are not sure how to write data, you can manually install it in the GUI on the test machine to obtain this address.

Driver_ppd: the path of the driver's ppd file.

Option: for example, if you want to set dual-sided printing to off by default, Most printers use Duplex = none. For specific parameters, see different printers.

You can complete the configuration on the test machine and then run the following command:

lpoptions -p YOUR_CUPS_PRINTER_NAME -l

To display all the parameter configurations of the printer. There is no limit on the number of options in the lpadmin command.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.