This section describes additional commands to manage printing after you have completed printer setup.
The lpstat command displays information about accessible printers and jobs.
$ lpstat [-d] [-l] [-p printer(s)] [-t]
Shows the current default printer.
Shows printers that are enabled or disabled for printing.
Separate multiple printer names with commas. If you do not specify a printer, the status of all printers is displayed.
Lists printers, classes, or jobs.
Shows status information about CUPS, including the status of all printers, for example whether printers are active and accepting print requests.
The following example shows the status of printers asteroid and luna with regards to their ability to accept print jobs:
$ lpstat -p "asteroid, luna" -d printer asteroid faulted. enabled since Jan 5 11:35 2011. available. unable to print: paper misfeed jam Description: Printer by break room printer luna is idle. enabled since Jan 5 11:36 2011. available. Description: Printer by server room.
The following command displays a long list of information about the printer luna:
$ lpstat -l -p luna printer luna is idle. enabled since September 29, 2011 05:20:57 PM BST Form mounted: Content types: any Printer types: unknown Description: luna Alerts: none Location: Connection: direct On fault: no alert After fault: continue Users allowed: (all) Forms allowed: (none) Banner required Charset sets: (none) Default pitch: Default page size: Default port settings:
To send a print job request to a printer, use either the lp or lpr command.
$ lp|lpr [-d printer] filename
For the lp or lpr command, the –d option specifies the destination printer other than the default printer.
For example, the following print job is being sent to the printer luna, but the default is printer is saturn.
$ lp -d luna abc.ps request id is luna-1 (1 file(s)) $ lpstat -d system default destination: saturn
For other options you can use with either command, see the lp(1) and the lpr(1) man pages.
The lpinfo command lists the available devices and drivers known to the CUPS server:
$ lpinfo [-m] [-v]
The –m option lists available drivers while the –v option lists available devices. Other options enable you to further filter the list. See the lpinfo(8) man page.
This example is an extract of the list of all available Xerox printers:
$ lpinfo --make-and-model Xerox -m foomatic:Xerox-2700_XES-xes.ppd Xerox 2700 XES Foomatic/xes foomatic:Xerox-3700_XES-xes.ppd Xerox 3700 XES Foomatic/xes foomatic:Xerox-4045_XES-xes.ppd Xerox 4045 XES Foomatic/xes gutenprint.5.2://xerox-able_1406/expert Xerox Able 1406 - CUPS+Gutenprint v5.2.4 gutenprint.5.2://xerox-able_1406/simple Xerox Able 1406 - CUPS+Gutenprint v5.2.4 Simplified ...
The following example displays all available devices:
# lpinfo -v network lpd network socket network http network ipp direct hal direct hp direct hpfax network RAW
To become an administrator, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.
$ lpoptions -x printer-name
$ cupsreject printer-name
This step prevents any new requests from entering the printer's queue while you are in the process of removing the printer.
$ cupsdisable printer-name
$ lpadmin -x printer-name
$ lpstat -l -p printer-name