Chapter 9. Printing

Originally contributed by Warren Block.
Table of Contents
9.1. Quick Start
9.2. Printer Connections
9.3. Common Page Description Languages
9.4. Direct Printing
9.5. LPD (Line Printer Daemon)
9.6. Other Printing Systems

Putting information on paper is a vital function, despite many attempts to eliminate it. Printing has two basic components. The data must be delivered to the printer, and must be in a form that the printer can understand.

9.1. Quick Start

Basic printing can be set up quickly. The printer must be capable of printing plain ASCII text. For printing to other types of files, see Section 9.5.3, “Filters”.

  1. Create a directory to store files while they are being printed:

    # mkdir -p /var/spool/lpd/lp
    # chown daemon:daemon /var/spool/lpd/lp
    # chmod 770 /var/spool/lpd/lp
  2. As root, create /etc/printcap with these contents:

    	:lp=/dev/unlpt0:\  1


    This line is for a printer connected to a USB port.

    For a printer connected to a parallel or printer port, use:


    For a printer connected directly to a network, use:


    Replace network-printer-name with the DNS host name of the network printer.

  3. Enable lpd by editing /etc/rc.conf, adding this line:


    Start the service:

    # service lpd start
    Starting lpd.
  4. Print a test:

    # printf "1. This printer can print.\n2. This is the second line.\n" | lpr


    If both lines do not start at the left border, but stairstep instead, see Section, “Preventing Stairstepping on Plain Text Printers”.

    Text files can now be printed with lpr. Give the filename on the command line, or pipe output directly into lpr.

    % lpr textfile.txt
    % ls -lh | lpr

All FreeBSD documents are available for download at

Questions that are not answered by the documentation may be sent to <>.
Send questions about this document to <>.