S5 version Table of Contents (frame/ no frame)
(28) Printing Previous Top Next

Printing

In Unix, the functions of preparing a file for printing (translating formats etc.) and sending the file to the printer, are usually separate. At Dartmouth essentially all public printers expect to be sent postscript, and the print spoolers detect when a file is already in postscript form and pass it unchanged. Anything else is assumed to be pure text, and is automatically translated to postscript. Programs which prepare their own formatted print files need to be set for postscript output.

All print jobs are queued. Access to the printer is controlled by a spool queue. Printers may be local or remote - there is no difference in the way they are used. All public printers at Dartmouth are remote. The "built-in" print command provided by many applications actually prepares a temporary file with the material to be printed, and calls one of the following utilities.

lpr [-Pprinter] file [file ...]
lpr sends the named file(s) to the printer (actually, append this job to the queue for the printer). If no printer is named, the variable $PRINTER is used. If it is not set, the system default printer is used. If no files are named, standard input is read, so that lpr can be the end of a pipe.
lpq [-Pprinter]
Check the queue for the named printer.
lprm [-Pprinter] job-number
Remove a print job from the queue, if it hasn't started printing yet.

lp [-dprinter] file [file ...]
lp is functionally similar to lpr. On most modern systems, both commands are available. "lpr" comes from the BSD heritage, while "lp" is from the SysV heritage. The "lpstat" and "cancel" commands are also part of the SysV printing tools.
lpstat
Check printer status, similar to "lpq"
cancel
Cancel a print job from the queue, similar to "lprm"

Utilities to provide more control over the formatting of plain text files vary from system to system. Check out pr and lwf on Nimbus and Northstar, or postprint on Sunray.

Previous Top Next


slide29.src  last modified Jan 31, 2011 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College