After it leaves your application, lpr takes the print job and preprocesses it according to any command line options or printer-specific configuration requirements. The resultant file and a paired file containing processing instructions are placed in a directory associated with the printer, called a spool directory or print queue (usually /var/spool/lpd/*). Print jobs stored in these directories are said to be spooled or queued. Multiple jobs may wait in these directories until the printer is ready to handle them. Once the file is successfully spooled, lpr notifies the printer daemon, lpd, that there is a new job awaiting processing.
The printer daemon filters the file according to the instructions left for it by lpr and passes the output to an actual printer device, typically /dev/lp??. The printer daemon handles all information exchange with the printer hardware. It is possible to bypass the daemon and cat stuff directly to the printer device, but it's not good form.
In addition, you should be aware that lpd uses printer-specific parameters stored in the /etc/printcap (a printer capabilities database, not unlike termcap and terminfo in function) to translate the generic print data into printer-specific sequences of control characters.
The commands covered in this section include the following:
lpc | Control the line printer system. |
lpd | The line printer daemon. |
lpq | Query the specified print spool. |
lpr | Send a file to the print queue. |
lprm | Remove a file from the print queue. |
pr | Print a file. |
tunelp | Modify printer characteristics. |