Table of Contents

Name

lpr - Spool files to a printer

Synopsis

lpr [-D] [-d device ] [-h] [-l] [-P device ]

Description

lpr spools a file to the specified printer device. No formatting is done -- data is sent "raw". This is useful, for example, for sending Postscript data to a Postscript printer.

Options

-D
enables some debugging output.
-d device
specifies the device to which to send the output.
-h
does nothing and is accepted for compatibility only.
-l
disables CR/LF translation. Normally, files are converted to DOS/Windows-style line endings (CR+LF) during the spooling process. Some drivers appear to require this translation, while most don’t seem to care. Including this option on the lpr command line disables any such translations.
-P device
an alias for -d.

Devices

A device name may be a UNC path (\\server_name\printer_name), a reserved DOS device name (e.g., prn, lpt1), or a local port name that is mapped to a printer share. Note that forward slashes may be used in a UNC path also (e.g., //server_name/printer_name).

Environment

A default device name may be specified in the PRINTER environment variable. Specifying a device via a -d or -P will override the environment variable setting.

Notes

Make sure that the default paper size setting is correct for the program that is formatting the page. For example, for enscript, make sure the DefaultMedia setting is correct in /etc/enscript.cfg. If this setting is incorrect, it is possible that no output at all will be produced by the printer. This is not an lpr issue.

Authors

Written by Rick Rankin.


Table of Contents