Operating System - Linux
1827845 Members
1212 Online
109969 Solutions
New Discussion

creating print queue from command line using CUPS

 
SOLVED
Go to solution
TCEQ UNIX
Advisor

creating print queue from command line using CUPS

I need to create many print queues with same options. I would like to use command line to create print queue. what would be the command and how do you put different options? thanks
He who does not slow down at the sight of a police car is usually parked.
1 REPLY 1
Tom Ward_1
Honored Contributor
Solution

Re: creating print queue from command line using CUPS

You have the manuals available from the web interface. Select help at the top of the page.

Here's the section on adding via command line, right from the CUPS manuals:

Run the lpadmin command with the -p option to add a printer to CUPS:

/usr/sbin/lpadmin -p printer -E -v device -m ppd ENTER

For an HP DeskJet printer connected to the parallel port this would look like:

/usr/sbin/lpadmin -p DeskJet -E -v parallel:/dev/lp1 -m deskjet.ppd ENTER

Similarly, an HP LaserJet printer using a JetDirect network interface at IP address 11.22.33.44 would be added with the command:

/usr/sbin/lpadmin -p LaserJet -E -v socket://11.22.33.44 -m laserjet.ppd ENTER

As you can see, deskjet.ppd and laserjet.ppd are the PPD files for the HP DeskJet and HP LaserJet drivers included with CUPS. You'll find a complete list of PPD files and the printers they will work with in Appendix C, "Printer Drivers".

For a dot matrix printer connected to the serial port this would might look like:

/usr/sbin/lpadmin -p DotMatrix -E -v serial:/dev/ttyS0?baud=9600+size=8+parity=none+flow=soft deskjet.ppd ENTER

Here you specify the serial port (e.g. S0,S1, d0, d1), baud rate (e.g. 9600, 19200, 38400, 115200, etc.), number of bits, parity, and flow control. If you do not need flow control, delete the "+flow=soft" portion.

Regards,
Tom