Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Administration: Common Tasks Oracle Solaris 11 Information Library |
1. Locating Information About Oracle Solaris Commands
2. Managing User Accounts and Groups (Overview)
3. Managing User Accounts and Groups (Tasks)
4. Booting and Shutting Down an Oracle Solaris System
5. Working With Oracle Configuration Manager
6. Managing Services (Overview)
9. Managing System Information (Tasks)
10. Managing System Processes (Tasks)
11. Monitoring System Performance (Tasks)
12. Managing Software Packages (Tasks)
14. Scheduling System Tasks (Tasks)
15. Setting Up and Administering Printers by Using CUPS (Tasks)
Setting Up Printers and Print Queues by Using CUPS
Managing Print Requests by Using CUPS
Setting Up Your Printing Environment to Work With CUPS
How to Set Up Your Printing Environment
Setting Up Your Printing Environment for an Upgrade
Setting Up and Administering Printers by Using CUPS Command-Line Utilities (Task Map)
Setting Up and Administering Printers by Using CUPS Command-Line Utilities
How to Set Up a Printer by Using the lpadmin Command
How to Set a Default Printer at the Command Line
How to Print to a Specified Printer
How to Verify the Status of Printers
Setting Up and Administering Printers by Using the CUPS Web Browser Interface (Task Map)
Setting Up and Administering Printers by Using the CUPS Web Browser Interface
Requirements for Using the CUPS Web Browser Interface
Troubleshooting Issues With Accessing the CUPS Web Browser Interface
About the CUPS Print Manager GUI
Setting Up Printers by Using CUPS Print Manager (Task Map)
Setting Up Printers by Using CUPS Print Manager
How to Configure CUPS to Administer Remote Print Queues
How to Set Up a New Local Printer
Administering Printers by Using CUPS Print Manager (Task Map)
Administering Printers by Using CUPS Print Manager
Configurable Printer Properties
How to Modify the Properties of a Configured Printer
How to Copy a Printer Configuration
How to Unshare or Share a Printer
How to Disable or Enable a Printer
How to Manage Print Jobs for a Specified Printer
16. Managing the System Console, Terminal Devices, and Power Services (Tasks)
17. Managing System Crash Information (Tasks)
18. Managing Core Files (Tasks)
19. Troubleshooting System and Software Problems (Tasks)
20. Troubleshooting Miscellaneous System and Software Problems (Tasks)
This section provides a brief description of the CUPS commands and describes how to set up and administer your printers.
CUPS provides various commands to set up printers and make those printers accessible to systems on the network. In addition, CUPS supports several printer-specific options that enable you to control printer configuration. The following table lists frequently used CUPS commands.
Note - Some CUPS command names are the same as legacy LP print commands, but the behavior of commands under CUPS management might be different.
Table 15-1 CUPS Command-Line Utilities
|
Consult the printer vendor's installation documentation for information about hardware switches and cabling requirements.
For more information, see How to Obtain Administrative Rights in Oracle Solaris Administration: Security Services
Only the most commonly used options of the CUPS lpadmin command are shown here. For information about other options, see the lpadmin(8) man page.
$ /usr/sbin/lpadmin -p printer-name -E -v device -m ppd
Specifies the name of the printer to add.
Enables the destination and accepts jobs.
Sets the device-uri attribute of the print queue.
Sets the PPD file for the printer from the model directory or by using one of the driver interfaces.
See the examples at the end of this procedure.
$ cupsaccept printer-name $ cupsenable printer-name
$ lpstat -p printer-name -l
Example 15-1 Adding a Printer That Is Connected to the Parallel Port
To add an HP DeskJet printer DeskJet that is connected to the parallel port, you would type the following command:
$ /usr/sbin/lpadmin -p DeskJet -E -v parallel:/dev/lp1 -m deskjet.ppd
PPD file for the HP DeskJet drivers included with CUPS
Example 15-2 Adding a Printer That Uses a PPD File
To add an HP LaserJet printer LaserJet by using a JetDirect network interface with the IP address 10.1.1.1, you would type the following command:
$ /usr/sbin/lpadmin -p LaserJet -E -v socket://10.1.1.1 -m laserjet.ppd
PPD file for the HP LaserJet drivers included with CUPS
Example 15-3 Adding a Printer That Is Connected to the Serial Port
To add a dot matrix printer that is connected to the serial port, you would type the following command:
$/usr/sbin/lpadmin -p DotMatrix -E -m epson9.ppd \ -v serial:/dev/ttyS0?baud=9600+size=8+parity=none+flow=soft
Specify the serial port, baud rate, number of bits, parity, and flow control. If you do not need flow control, delete the +flow=soft attribute.
You can specify the default printer in one of the following ways:
By setting the LPDEST or PRINTER environment variable.
The LPDEST environment variable determines the destination of the printer. If the LPDEST variable is not set, the PRINTER variable is used. The PRINTER variable determines the output device or destination. If both the LPDEST and PRINTER variables are not set, an unspecified device is used. For instructions on setting up a default printer by specifying the environment variables, see How to Set a Default Printer at the Command Line.
By using the new lpoptions command.
Use this command to display or set printer options and defaults. For instructions on setting up a default printer by using the CUPS commands, see How to Set a Default Printer at the Command Line. For more information, see the lpoptions(1) man page.
The print command searches for the default printer in the following order:
The printer name as set by the lp command with the -d option
The value of the LPDEST environment variable
The value of the PRINTER environment variable
For instructions on setting up printers by using the CUPS web browser interface, see Setting Up and Administering Printers by Using the CUPS Web Browser Interface .
The default printer can be a local printer or a remote printer.
$ export PRINTER=printer-name
where printer-name specifies the name of the printer to be assigned as the system's default printer. If you do not specify printer-name, the system is set up with no default printer.
Note - When using the lp command with the -d option, the destination printer, which might not be the default printer, is specified. If the -d option is not specified, the print command searches for information about the printer in the PRINTER environment variable.
$ export LPDEST=printer-name
where printer-name specifies the name of the printer to be assigned as the system's default printer. If you do not specify printer-name, the system is set up with no default printer.
Note - If both the LPDEST and the PRINTER environment variables are set, LPDEST takes precedence.
$ lpoptions -d printer-name
Specifies the destination printer.
Specifies the name of the printer that is assigned as the system's default printer. If you do not specify printer-name, the system is set up with no default printer.
For more information, see the lpoptions(1) man page.
$ lpstat -d
$ lp filename
Example 15-4 Setting a Default Printer by Specifying the PRINTER Variable
The following example shows how to set the printer luna as the system's default printer by using the PRINTER variable.
$ export PRINTER=luna $ lpstat -d system default destination: luna
Example 15-5 Setting a Default Printer by Specifying the LPDEST Variable
The following example shows how to set the printer luna as the system's default printer by specifying the LPDEST variable.
$ export LPDEST=luna $ lpstat -d system default destination: luna
Example 15-6 Setting a Default Printer by Using the lpoptions Command
The following example shows how to set the printer luna as the system's default printer. The printer luna is used as the system's default printer if the LPDEST or the PRINTER environment variable is not set.
$ lpoptions -d luna $ lpstat -d system default destination: luna
The lpoptions command creates a ~/.lpoptions file that includes and entry for the default printer luna in the file. By default, all print jobs are now directed to the luna printer.
$ lpstat -p printer-name
$ lp -d destination-printer filename
Specifies the destination printer.
Specifies the name of the printer that you are assigning as the destination printer.
Specifies the file name to print.
Note - You can also use the lpr command with the -p option to submit a print request to a specific printer. For more information, see the lpr(1) man page.
Example 15-7 Printing to a Specified Printer by Using the lp Command
The following example shows how to set the printer luna as the destination printer.
$ lp -d luna abc.ps request id is luna-1 (1 file(s)) $ lpstat -d system default destination: saturn
The -d option of the lp command takes precedence over the LPDEST and PRINTER environment variables.
Note that in this example, the default printer is saturn.
The lpstat command displays information about accessible printers and jobs.
Only the most commonly used options are shown here. For information about other options, see the lpstat(1) man page.
$ lpstat [-d] [-p] printer-name [-l] [-t]
Shows the system's default printer.
Shows that a printer is active or idle, and when the printer was enabled or disabled.
You can specify multiple printer names with this command. Use a space or a comma to separate printer names. If you use spaces, enclose the list of printer names in quotation marks. If you do not specify printer-name, the status of all printers is displayed.
Shows the characteristics of printers and jobs.
Shows status information about CUPS, including the status of all printers, for example whether printers are active and accepting print requests.
Example 15-8 Displaying the Status of Printers
To display the status of the printer luna:
$ lpstat -p luna printer luna is idle. enabled since Jul 12 11:17 2011. available.
To display the system's default printer:
$ lpstat -d system default destination: luna
To display the description of the printers asteroid and luna:
$ 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.
To display the characteristics of the printer luna:
$ lpstat -p luna -l printer luna is idle. enabled since September 29, 2011 05:20:57 PM BST
$ lpstat -p printer-name
$ lp filename
$ lpr filename
Note - Only the basic commands are shown in this procedure. For information about the other options, see the lp(1) and the lpr(1) man pages.
$ lpoptions -x printer-name
Specifies the name of the printer to delete.
Deletes the specified printer.
Note - The -x option only removes the default options for a specific printer and instance. The original print queue still remains until it is deleted by using the lpadmin command.
$ 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 -p printer-name -l
The command output displays a message indicating the printer does not exist.
$ lpstat -p printer-name -l
The command output displays a message indicating that the printer does not exist.
Example 15-9 Deleting a Printer
The following example shows how to delete the printer luna from the print client terra and from the print server jupiter.
terra# lpoptions -x luna terra# lpstat -p luna -l jupiter# lpadmin -x luna jupiter# lpstat -p luna -l lpstat: Invalid destination name in list "luna"!