Book Image

CUPS Administrative Guide

By : Ankur Shah
Book Image

CUPS Administrative Guide

By: Ankur Shah

Overview of this book

Table of Contents (16 chapters)
CUPS Administrative Guide
Credits
About the Author
Acknowledgement
About the Reviewer
Preface

Managing Printer Classes Through Command-Line


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.

Adding a Printer to a 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

Removing a Printer from a Class

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:

Removing a Class

To remove a class, you can run the lpadmin command with the -x option:

$sudo lpadmin...