System Administration Guide
Chapter 4, Managing printers and print jobs

Grouping printers into a class

Grouping printers into a class

To group printers into a printer class, add each printer to the class using the following command: 

/usr/lib/lpadmin -p printer_name -c class_name 

For example, to add printer snapper to the class fish, enter:

/usr/lib/lpadmin -p snapper -c fish

If the class does not exist, lpadmin creates it.

NOTE: Class names and printer names must be unique. This allows a user to specify the destination of a print request without having to know whether it is a class of printers or a single printer. Thus, you cannot have a class and printer with the same name.

A printer does not belong to any class until you add it to one.

To list all the classes and the printers that belong to them, enter:

lpstat -c 

You see a display similar to:

   members of class fish:

To remove a printer from a class, enter: 

/usr/lib/lpadmin -p printer_name -r class_name

For example, remove printer salmon from class fish:

/usr/lib/lpadmin -p salmon -r fish

If the printer was the only member of the class, the class is removed.

To remove a class, enter: 

/usr/lib/lpadmin -x class_name

Removing a class does not remove the printers that were members of the class.

NOTE: You can remove a printer or class only if it has no pending print requests. If there are pending requests, you must first transfer them to another printer or class or remove them. See ``Transferring a job to another printer'' and ``Deleting print jobs''.

If the printer or class removed is also the system default destination, the system no longer has a default destination.

See also: