You can perform this task only by using the lpadmin -c
command. Jobs sent to a printer class are forwarded to the first available printer in the printer class.
You can run the following command with the -p
and -c
options to add a printer to a class:
$sudo lpadmin -p cupsprinter -c cupsclass
The above example shows that the printer cupsprinter
has been added to printer class cupsclass
:
You can verify whether the printers are in a printer class:
$lpstat -c cupsclass
You need to run lpadmin
command with -p
and -r
options to remove printer from a class. If all the printers from a class are removed, then that class can get deleted automatically.
$sudo lpadmin -p cupsprinter -r cupsclass
The above example shows that the printer cupsprinter
has been removed from the printer class, cupsclass
: