printcap(5)
Name
printcap − printer capability data base
Syntax
/etc/printcap
Description
The printcap file describes the printers available on a system. There is one entry in the file for each printer, and the entry describes the printer capabilities. A change to the printcap file immediately affects the spooling system, unless the affected queue is active. In this case, the spooling queue should be stopped and restarted. For more information, refer to lpc(8).
Entries in the printcap file comprise a number of fields separated by colons (:). The first entry for each printer gives the names that are known for the printer. The names are separated by the pipe character (|). The first name is the name of the printer that will be displayed when you use the lpc command to show the status of a queue. Second and subsequent names are alternative names for the printer. You can use the last name to fully identify the printer, including blanks for readability if necessary.
The /etc/printcap file is created when the system is installed. After this, you can modify the printcap file by using the lprsetup script or a suitable editor. The lprsetup script is described on the lprsetup(8) reference page and in the Guide to System Environment Setup.
When a file is printed using the lpr command, the file can be sent to a named printer. If a printer is not named, and a print name is not defined by the PRINTER environment variable, the file is sent to the printer with the name “lp” in the printcap file. The printcap file should always have a printer with the name “lp”.
Examples
A typical entry for a printer in the printcap file would be:
lp|lp0|nlp|ln03 in room 4:\
:af=/usr/adm/lpacct:\
:br#4800:\
:fc#0177777:\
:fs#03:\
:if=/usr/lib/lpdfilters/ln03of:\
:lf=/usr/adm/lperr:\
:lp=/dev/tty00:\
:mx#0:\
:of=/usr/lib/lpdfilters/ln03of:\
:pl#66:\
:pw#80:\
:sd=/usr/spool/lpd:\
:xc#0177777:\
:xs#044000:
This example shows the format of an entry created using the lprsetup script. For more information, refer to the Guide to System Environment Setup.
Capabilities
There are three types of capabilities in the printcap file: Boolean, string, and numeric. String valued capabilities are processed before use. For more details, refer to termcap(5). The following list contains the names of capabilities that can be used in the printcap file:
| Name | Type | Default | Description |
| af | str | NULL | Accounting file name |
| br | num | none | Baud rate, set if lp is a tty |
| (ioctl call) | |||
| cf | str | NULL | Cifplot data filter |
| ct | str | "dev" | Connection type - only valid |
| when uv=psv1.0 (choices are: | |||
| dev, lat,remote, network) | |||
| db | num | 0 | Debugging level (choices are: |
| 0 (none), 1 (normal), 10 | |||
| (do not execute job, describe | |||
| actions to log file)) | |||
| df | str | NULL | Text data filter (DVI format) |
| du | num | Daemon user id | |
| fc | num | 0 | If lp is a tty, clear octal |
| flag values ( tty(4) sg_flags) | |||
| ff | str | "\f" | String to send for a form feed |
| fo | bool | false | Print a form feed when device |
| is opened | |||
| fs | num | 0 | If lp is a tty, set octal flag |
| values ( tty(4) sg_flags) | |||
| gf | str | NULL | Graph data filter (plot(3X) |
| format) | |||
| if | str | NULL | Text filter that does |
| accounting | |||
| lf | str | "/dev/console" | Error logging file name |
| lo | str | "lock" | Lock file name |
| lp | str | "/dev/lp" | Device name to open for |
| output | |||
| mc | num | Maximum number of copies allowed | |
| mx | num | 1000 | Maximum file size (in 1kbyte |
| blocks), 0 = unlimited | |||
| nf | str | NULL | Ditroff (device independent |
| troff) data filter | |||
| of | str | NULL | Output filtering program name |
| op | str | NULL | The entry in the “Name” field |
| for LAT port characteristics | |||
| os | str | NULL | Service name supported on some |
| terminal servers | |||
| pl | num | 66 | Page length (in lines) |
| pp | str | "/bin/pr" | Print filter |
| ps | str | "non_PS" | Printer type (choices are: |
| non_PS, LPS) | |||
| pw | num | 132 | Page width (in characters) |
| px | num | 0 | Page width in pixels |
| py | num | 0 | Page length in pixels |
| rf | str | NULL | Filter for printing Fortran |
| style text files | |||
| rm | str | NULL | Machine name for remote printer |
| rp | str | "lp" | Remote printer name argument |
| rs | bool | false | Restrict remote users to those |
| with local accounts | |||
| rw | bool | false | Open the printer device for |
| reading as well as writing | |||
| sb | bool | false | Short banner (one line only) |
| sc | bool | false | Suppress multiple copies |
| sd | str | "/usr/spool/lpd" | Spool directory |
| sf | bool | false | Suppress form feeds |
| sh | bool | false | Suppress printing of banner |
| page header | |||
| st | str | "status" | Status file name |
| tf | str | NULL | Troff data filter (cat |
| phototypesetter) | |||
| tr | str | NULL | Trailer string to print when |
| queue empties | |||
| ts | str | NULL | LAT terminal server node name |
| uv | str | "3.0" | ULTRIX version number (choices |
| are: 3.0, psv1.0) | |||
| vf | str | NULL | Raster image filter |
| xc | num | 0 | If lp is a tty, clear local |
| mode octal values ( tty(4) "Local mode") | |||
| xf | str | NULL | Transparent mode filter |
| xs | num | 0 | If lp is a tty, set local mode |
| octal values ( tty(4) "Local mode") |
The following capabilities set defaults for PostScript (TM) printers. You should refer to the lpr(1) reference page for the choices available for each capability. The equivalent lpr options are shown for reference purposes.
| Name | Type | Default | Description | lpr Option |
| Da | str | "ps" | Data type | −D |
| It | str | NULL | Input tray | −I |
| Lu | str | NULL | Layup definition file | −L |
| Ml | str | NULL | Record messages | −M |
| Nu | str | NULL | Number up | −N |
| Or | str | "portrait" | Orientation | −O |
| Ot | str | NULL | Output tray | −o |
| Ps | str | NULL | Page size | −F |
| Sd | str | NULL | Default sheet size | |
| (see below) | ||||
| Si | str | NULL | Sides | −K |
| Ss | str | NULL | Sheet size | −S |
| Ul | str | last page | Upper page limit | −Z |
| Xf | str | "xlator_call" | Translator dispatch | |
| program | ||||
| Lf | str | "layup" | Layup to PostScript | |
| (TM) translator | ||||
| Dl | str | "/usr/lib/ | Name of the device | |
| lpdfilters/ | control module | |||
| lps_v3.a" | library file |
The Ss capability specifies a mandatory sheet size. The print job fails if this sheet size is not available with the printer.
The Sd capability specifies a preferred sheet size and is overridden by the Ss capability and the lpr −S command. If the sheet size specified by the Sd capability is not available, the print job does not fail, but is printed on the default sheet size for the printer.
The Dl capability specifies the name of the device control module library file. This file should be either /usr/lib/lpdfilters/lps40.a if the PrintServer supporting host software is Version V2.0 or V2.1, or /usr/lib/lpdfilters/lps_v3.a if the PrintServer supporting host software is Version V3.0.
See Also
lpq(1), lpr(1), lprm(1), termcap(5), lpc(8), lpd(8), pac(8)
Guide to System Environment Setup