Understanding printcap

The /etc/printcap file defines the printers and their characteristics. Understanding a printcap file is the most difficult part of configuring a Linux printer server. There are an enormous number of possible configuration parameters, and the syntax of many of the parameters is terse and arcane. The complexity of the printcap file is one reason why tools such as printconf were created.

Generally, you use a tool to configure a printer. You don't directly edit the printcap file. In fact, if you ever want to create your own printcap entries, you should place them in /etc/printcap.local, which is a file that is included into printcap during processing. Despite the fact that it is unlikely you will manually build a printcap file, a system administrator should understand the content of the file well enough to read it and get a general idea of what it is doing. To do that, you need a basic understanding of the file structure and the configuration parameter syntax.

The file contains one entry for each active printer. Printer entries can span multiple lines by ending a line with a backslash (\) to indicate that the following line is a continuation line, and beginning the continuation line with a vertical bar (|) or a colon (:). Every field in a printer entry, other than the printer name, begins and ends with a colon.

Each printer entry starts with a printer name. Multiple printer names can be used if they are separated by vertical bar characters. Traditionally, one printer was always named lp, and many configurations continue to require that one printer has the name lp.

Every active line in the printcap file begins with a printer name, a vertical bar, or a colon. Comments begin with a hash mark (#). Blank lines and leading blank characters are ignored.

Was this article helpful?

0 0

Post a comment