Printing (Topic 1.107)

Objective 2: Manage Printers and Print Queues

  • 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.

  • lpr submits jobs to print queues.

  • 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.

Objective 3: Print Files

  • Files are printed with the lpr command:

    # lpr /etc/lilo.conf
    # man -t 5 myfile.txt | lpr -Pqueue2

Objective 4: Install and Configure Local and Remote Printers

/etc/printcap

  • 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. ...

Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.