Printing with Linux


If you did not set up your printer during installation or you are adding a new printer, a useful program for doing this "is Red Hat's Printtool. Other distributions have printer configuration tools, however, Printtool is well suited for beginners. This program has a graphical interface and can be used to configure either a local or network printer. For ease of use it is recommended over manually editing the /etc/printcap configuration file. The software that controls the print spooling is the line-printer deamon (lpd), and although there are other programs available for Linux such as PDQ and LPRng, lpd is the most popular.

Before you attempt to add a printer, you should connect it to the computer first. This allows Printtool to detect the printer's location. To use Printtool you will need to be running X Windows and be logged into a terminal as root, then type:

$ printtool

The Linux Print System Manger window will appear and you have the "option to edit, add or delete a printer. Selecting "add" will give you the choice of adding a local, remote Unix, SMB/Windows (Samba) or NetWare printer.

If you chose to add a local printer, Printtool will attempt to detect the location of the printer. Clicking OK once the correct location is detected will reveal the Edit Local Printer window: here you will need to assign a name for the printer, the spool directory (which is usually /var/spool/lpd/printer where printer is the name of your printer, e.g., Epson800), the file limit and the input filter. The input filter is where various printer specifications such as model selection, text or PostScript, printing resolution and paper size are set. Once the new printer is installed, print a test page from the Tests menu. If printing does not work, try restarting lpd or editing the input filter settings.

Printtool will also help you configure a remote (network) printer for your Linux system. Adding a remote printer is much the same as adding a local printer, apart from a few specific configuration parameters. If you intend to add support for a remote Unix printer, you will need to specify the hostname of the computer, which controls the printer as well as the remote queue. Similarly, adding an SMB/Windows printer involves the same information, such as a local name and a TCP/IP hostname. However, you will also need to include the remote printer name, a user name and a password. Finally, you can also add a NetWare printer by specifying the NetWare server name for the printer and the print queue name. To be able to print to a NetWare printer, you must have the package's ncpfs (NetWare NCP file system program) and ipxutils (IPX file transfer protocol utilities) installed.

This month's cover CD includes the necessary programs for printer configuration as well as the Linux Printing HOWTO from the Linux Documentation Project.


When you start your computer, the lpd process begins by reading the /etc/printcap file to see which printers are set up (either locally or over a network) and handle print job requests. If lpd is running and your printer is configured, you can use the offline print (lpr) command to print files. For example:

$ lpr linux.txt

will print the text file "linux.txt". As with most other Linux commands, lpr supports various options or "flags" that can be added for specific purposes. Issuing the command:

$ lpr -P printer2 -#5 linux.txt

will tell "printer2" to print five copies of "linux.txt". The -P option is used to specify which printer to print to and is used when more than one printer is supported by your computer. Also, the -#n option specifies the number of pages to be printed (replace n by the number of pages). See the manual page by typing man lpr at the command prompt for more details about lpr.

Just as lpr can be used to send jobs "to the print queue, the lprm command can be used to remove them. To remove "the current jobs from a particular printer, all a user needs to do is execute:

$ lprm -P printer2

Similarly, a root user can remove all the print jobs for a specific user by issuing:

$ lprm tux

where tux is a username. To remove a specific job you will need to know the job number first, which is determined with the lpq command. Issuing lpq will display a list of the current jobs waiting to be printed. Typing:

$ lpq -l

will also display the job number. Therefore, using lprm, you can remove a specific job by typing:

$ lprm jobnumber

where "jobnumber" is replaced by the number assigned to that job.

Whether you have configured your printer during installation or with a program such as Printtool, printing with Linux is a very useful tool. Particularly useful features include network printing and the ability to control jobs that are in the queue.

Join the PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Rodney Gedda

PC World
Show Comments

Cool Tech

Crucial Ballistix Elite 32GB Kit (4 x 8GB) DDR4-3000 UDIMM

Learn more >

Gadgets & Things

Lexar® Professional 1000x microSDHC™/microSDXC™ UHS-II cards

Learn more >

Family Friendly

Lexar® JumpDrive® S57 USB 3.0 flash drive 

Learn more >

Stocking Stuffer

Plox Star Wars Death Star Levitating Bluetooth Speaker

Learn more >

Christmas Gift Guide

Click for more ›

Most Popular Reviews

Latest News Articles


GGG Evaluation Team

Kathy Cassidy


First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni


For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell


The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi


The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott


My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?