To learn more about CUPS and to get a basic overview of the system, browse to http://www.cups.org/.
Console Print Control
Older versions of Red Hat Linux used the 4.3BSD line-printer spooling system and its suite of text-based printing utilities. Newer versions of these utilities, with the same names, are included with your Fedora DVD, but are part of the CUPS package. The commands support the launching of print jobs in the background (as a background process), the printing of multiple documents, the capability to specify local and networked printers, control of the printers, and management of the queued documents waiting in the printer's spool queue.
Using Basic Print Commands
After configuring your printer, you can print from the desktop, using any printer-capable graphical clients. If you do not use the desktop but prefer to use or access your Fedora system via a text-based interface, you can enter a number of print commands from the command line, too. The main CUPS commands used to print and control printing from the command line are as follows:
► lp — The line-printer spooling command; used to print documents that use a specific printer
► lpq — The line-printer queue display command; used to view the existing list of documents waiting to be printed
► lpstat — Displays server and printer status information
► lprm — The line-printer queue management command; used to remove print jobs from a printer's queue
► lpc — The line-printer control program; used by the root operator to manage print spooling, the lpd daemon, and printer activity
These commands offer a subset of the features provided by CUPS, but can be used to start and control printers and print queues from the command line.
You print files (documents or images) by using the lp command, along with a designated printer and filename. For example, to print the file mydoc.txt with the printer named lp, use the lp command, its -d command-line option, and the printer's name, like this:
# lp -dlp mydoc.txt
Managing Print Jobs
You can also print multiple documents from the command line. For example, to simultaneously print a number of files to the lp printer, use lpr like so:
# lp -dlp *.txt
This approach uses the wildcard capabilities of the shell to feed the lpr command all files in the current directory with a name ending in .txt for printing. Use the lpq command to view the printer's queue, as follows:
# lpq
lp is ready and printing
Rank Owner Job File(s) Total Size
active root 7 classes.conf 3072 bytes
The lpq command reports on the job, owner, job number, file being printed, and size of job. The job number (7 in this example) is used by CUPS to keep track of documents printing or waiting to be printed. Each job has a unique job number. To stop the print job in this example, use the lprm command, followed by the job number, like this:
# lprm 7
The lprm command removes the spooled files from the printer's queue and kills the job. Print job owners, such as regular users, can remove only spooled jobs that they own. As the root operator, you can kill any job.
Only the root operator can use the lpc command to administer printers and queues because the command is primarily used for printer and queue control. You, as a regular user, cannot use it to rearrange the order of your print jobs, but you can get a display of the status of any system printer. Start lpc on the command line like this:
# /usr/sbin/lpc
The lpc command has built-in help, but it consists of only five commands: exit, help, quit, status, and ?. The status command shows the status of a specified printer or all printers:
# lpc
lpc> ?
Commands may be abbreviated. Commands are:
exit help quit status ?
lpc> status
lp:
printer is on device 'parallel' speed -1
queuing is enabled
printing is enabled
no entries
daemon present
netlp:
printer is on device 'parallel' speed -1
queuing is enabled
printing is enabled
no entries
daemon present
lpc> quit
The preceding sample session shows a status report for two printers: lp and netlp. Another helpful command is lpstat, which you use like this with its -t option:
# lpstat -t
scheduler is running
system default destination: lp
device for lp: paralleclass="underline" /dev/lp0
device for netlp: paralleclass="underline" /dev/lp0
lp accepting requests since Jan 01 00:00
netlp accepting requests since Jan 01 00:00
printer lp is idle. enabled since Jan 01 00:00
printer netlp is idle. enabled since Jan 01 00:00!)
This command lists all status information about printer queues on the local system.
Avoiding Printer Support Problems
Troubleshooting printer problems can be frustrating, especially if you find that your new printer is not working properly with Linux. First, keep in mind that nearly all printers on the market today work with Linux. However, some vendors have higher batting averages in the game of supporting Linux. If you care to see a scorecard, browse to http://www.linuxprinting.org/vendors.html.
All-in-One (Print/Fax/Scan) Devices
Problematic printers, or printing devices that might or might not work with Fedora, include multifunction (or all-in-one) printers that combine scanning, faxing, and printing services. You should research any planned purchase, and avoid any vendor unwilling to support Linux with drivers or development information.
One shining star in the field of Linux support for multifunction printers is the HP support of the HP OfficeJet Linux driver project at http://hpoj.sourceforge.net/. Printing and scanning are supported on many models, with fax support in development.
Using USB and Legacy Printers
Other problems can arise from the lack of a printer's USB vendor and device ID information — a problem shared by some USB scanners under Linux. For information regarding USB printer support, you can check with the Linux printing folks (http://www.linuxprinting.org/vendors.html) or with the Linux USB project athttp://www.linux-usb.org/.