Printers are assigned to queues, which are managed by lpd, the print daemon. lpd listens for inbound print requests, forking a copy of itself for each active print queue.
lpq queries and displays queue status.
lprm allows jobs to be removed from print queues.
lpc allows root to administer queues; it has both interactive and command-line forms.
Filters translate data formats into a printer definition language.
Spool directories hold spooled job data.
New printer definitions are added to /etc/printcap:
lp|ljet: :sd=/var/spool/lpd/lp: :mx#0: :sh: :lp=/dev/lp0: :if=/var/spool/lpd/lp/filter: :lf=/var/spool/lpd/lp/log:
The lines in this example are defined as follows:
lp|ljet:
This parameter defines two alternate names for the printer, lp or ljet.
sd=
spool_directory
This parameter specifies the spool directory, under /var/spool/lpd.
mx=
max_size
The maximum size of a print job in blocks. Setting this to #0
indicates no limit.
sh
Suppress header pages. Placing this attribute in printcap sets it, eliminating the headers.
lp=
printer_device
The local printer device, such as a parallel port.
if=
input_filter
The input filter to be used. See "Filters" in Chapter 15 for additional information.
lf=
log_file
The file where error messages are logged.
Printing on a remote system or network printer is done through a local queue. /etc/printcap for the local queue looks something like this:
rlp: :sd=/var/spool/lpd/rlp: :rm=lphost: :rp=rlp: :mx#0: :sh: :if=/usr/local/bin/magicfilter :
Printing to Windows printers is similar and uses the smbprint filter:
winpr: :sd=/var/spool/lpd/winpr: :mx#0: :sh: :if=/usr/bin/smbprint: