PRINTCAP(5)
๐ธ PRINTCAP(5) โ printcap ๐
okay bestie, so this is the manual page for printcap from the File Formats Manual, and it's literally the printer capability database. it's serving file-format realness, and i'm gonna walk you through every single crumb. ๐
โจ NAME โจ
printcap โ printer capability database ๐
โจ SYNOPSIS โจ
printcap
โจ DESCRIPTION โจ
so. the printcap file is a simplified lil sibling of the termcap(5) database, and its whole job is describing line printers. the spooling system reads the printcap file every single time it's used, which means you can dynamically add and delete printers โ iconic behavior, no restart needed, we love that for us. every entry in the database describes exactly one printer.
โ ๏ธ okay so this part matters: this database may not be substituted for, the way it's possible with termcap(5), because it may allow accounting to be bypassed. so don't try it. periodt.
the default printer is normally lp, though the environment variable PRINTER may be used to override this. and every spooling utility supports an option, -Pprinter, so you can explicitly name a destination printer. ๐ซถ
if you want the complete discussion on how to set up the database for a given printer, go read the 4.3 BSD Line Printer Spooler Manual. it's giving required reading.
โจ CAPABILITIES โจ
for the file layout deets, refer to termcap(5). here's the whole roster of capabilities โ name, type, default, description, all of it, no crumbs left behind: ๐ฆ
afโ str โ defaultNULLโ name of accounting filebrโ num โ defaultnoneโ iflpis a tty, set baud rate (ioctl(2)call)cfโ str โ defaultNULLโ cifplot data filterdfโ str โ defaultNULLโ tex data filter (DVI format)fcโ num โ default0โ iflpis a tty, clear flag bits (โจsgtty.hโฉ)ffโ str โ defaultโ\fโโ string to send for a form feedfoโ bool โ defaultfalseโ print a form feed when device is openedfsโ num โ default0โ iflpis a tty, set flag bits (โจsgtty.hโฉ)gfโ str โ defaultNULLโ graph data filter (plot(3)format)hlโ bool โ defaultfalseโ print the burst header page lasticโ bool โ defaultfalseโ supports non-standard ioctl to indent printoutifโ str โ defaultNULLโ name of text filter which does accountinglfโ str โ default/dev/consoleโ error logging file nameloโ str โ defaultlockโ name of lock filelpโ str โ default/dev/lpโ local printer device, orport@hostfor remotemsโ str โ defaultNULLโ list of terminal modes to set or clearmxโ num โ default1000โ max file size (inBUFSIZblocks);0=unlimitedndโ str โ defaultNULLโ next directory for queues list (unimplemented)nfโ str โ defaultNULLโ ditroff data filter (device independent troff)ofโ str โ defaultNULLโ name of output filtering programpcโ num โ default200โ price per foot or page in hundredths of centsplโ num โ default66โ page length (in lines)pwโ num โ default132โ page width (in characters)pxโ num โ default0โ page width in pixels (horizontal)pyโ num โ default0โ page length in pixels (vertical)rfโ str โ defaultNULLโ filter for printing FORTRAN style text filesrgโ str โ defaultNULLโ restricted group-only group members can accessrmโ str โ defaultNULLโ machine name for remote printerrpโ str โ defaultlp'' `` โ remote printer name argumentrsโ bool โ defaultfalseโ remote users must have a local accountrwโ bool โ defaultfalseโ open printer device for reading and writingsbโ bool โ defaultfalseโ short banner (one line only)scโ bool โ defaultfalseโ suppress multiple copiessdโ str โ default/var/spool/lpdโ spool directorysfโ bool โ defaultfalseโ suppress form feedsshโ bool โ defaultfalseโ suppress printing of burst page headerstโ str โ defaultstatusโ status file nametfโ str โ defaultNULLโ troff data filter (cat phototypesetter)trโ str โ defaultNULLโ trailer string to print when queue emptiesvfโ str โ defaultNULLโ raster image filterxcโ num โ default0โ iflpis a tty, clear local mode bits (tty(4))xsโ num โ default0โ iflpis a tty, set local mode bits (tty(4))
and one more lil note for the girlies: if the local line printer driver supports indentation, the daemon must understand how to invoke it. no exceptions. ๐
โจ FILTERS โจ
if a printer is specified via lp (either local or remote), the lpd(8) daemon creates a pipeline of โfiltersโ to process files for various printer types. ๐ซ
๐จ important caveat: the pipeline is not set up for remote printers specified via rm unless the local host is the same as the remote printer host given.
which filters get selected depends on the flags passed to lpr(1). here's the pipeline that gets set up:
p pr | if regular text + pr(1)
none if regular text
c cf cifplot
d df DVI (tex)
g gf plot(3)
n nf ditroff
f rf Fortran
t tf troff
v vf raster image
๐ the if filter
the if filter is invoked with these arguments:
if [-c] -wwidth -llength -iindent -n login -h host acct-file
okay let's break it down because this is giving detail-heavy and we love accuracy:
- the
-cflag is passed only if the-lflag (pass control characters literally) is specified tolpr(1). widthandlengthspecify the page width and length (frompwandpl, respectively) in characters.- the
-nand-hparameters specify the login name and host name of the owner of the job, respectively. - the
acct-filefunction is passed from theafprintcap entry.
๐ no if? use of
if no if is specified, of is used instead โ with the distinction that of is opened only once, while if is opened for every individual job. so basically, if is better suited to performing accounting. ๐
the of is only given the width and length flags.
๐ all the other filters
all other filters are called as:
filter -xwidth -ylength -n login -h host acct-file
where width and length are represented in pixels, specified by the px and py entries, respectively. and here's the vibe check on all filters: they take stdin as the file, stdout as the printer, may log either to stderr or using syslog(3), and must not ignore SIGINT. ๐ค no cap.
โจ LOGGING โจ
error messages generated by the line printer programs themselves are logged by syslog(3) using the LPR facility. ๐ชต
messages printed on stderr of one of the filters get sent to the corresponding lf file. and the filters may, of course, use syslog(3) themselves โ they're grown, they can log however they want. ๐
and one tiny lil detail: error messages sent to the console have a carriage return and a line feed appended to them, rather than just a line feed. yes bestie, \r\n, it's giving old school. ๐
โจ SEE ALSO โจ
and also: the 4.3 BSD Line Printer Spooler Manual. ๐
โจ HISTORY โจ
the printcap file format appeared in 4.2BSD. it's an OG, it's been here since forever, and honestly? iconic behavior. ๐
so that's the whole entire page, every flag, every default, every filter, every lil caveat โ nothing skipped, nothing summarized, we ate and left no crumbs. ๐
๐ฆ mwah, this page lives on Debian, dated December 11, 1993, and it's filed under PRINTCAP(5) in the manual. slay, bye bestie!! ๐โจ๐
๐ฆ where this page comes from
- debian bookworm: lpr 1:2008.05.17.3+nmu1
- debian trixie: lpr 1:2008.05.17.3+nmu3.1 ยท BSD-3-Clause
- ubuntu jammy: lpr 1:2008.05.17.3+nmu1
- ubuntu noble: lpr 1:2008.05.17.3+nmu1
- ubuntu questing: lpr 1:2008.05.17.3+nmu3.1
- ubuntu resolute: lpr 1:2008.05.17.4 ยท BSD-3-Clause
- ubuntu stonking: lpr 1:2008.05.17.4 ยท BSD-3-Clause
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms