[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Commands Reference, Volume 3

lpr Command

Purpose

Enqueues print jobs.

Syntax

lpr [ -f ] [ -g ] [ -h ] [ -j ] [ -l ] [ -m ] [ -n ] [ -p ] [ -r ] [ -s ] [ -P Printer ] [ -# NumberCopies ] [ -C Class ] [ -J Job ] [ -T Title ] [ -i [ NumberColumns ] ] [ -w Width ] [ File ... ]

Description

The lpr command uses a spooling daemon to print the named File parameter when facilities become available. If no files are specified, the lpr command reads from standard input.

Flags

-# Number Produces multiple copies of output, using the Number variable as the number of copies for each file named.
-C Class Specifies the print Class as the job classification on the burst page.
-f Uses a filter which interprets the first character of each line as a standard FORTRAN carriage control character.
-g The files are assumed to contain standard plot data.
-h Suppresses printing of the burst page.
Note: The default is to print a header page and not a trailer page.
-i [Number] Indents output Number spaces. If the Number variable is not given, eight spaces are used as the default.
-j Specifies that the message Job number is: nnn, where nnn is the assigned job number, be displayed to standard output. This occurs only if the job is submitted to a local print queue.
-J Job Prints the Job variable as the job name on the burst page. Normally, the lpr command uses the name of the first file.
-l (Lowercase L) Uses a filter which allows control characters to be printed.
-m Sends mail upon completion of spooling.
-n Uses a filter which formats files containing ditroff (device-independent troff) data.
-P Printer Forces output to the Printer variable. If this flag is not specified, the following conditions occur:
-p Uses the pr command to format the file (lpr -p is very much like pr | lpr).
  • If a default exists, the lpr command uses the default printer.
  • If the LPDEST environment variable is set, then lpr uses the value specified by the LPDEST variable. If set, this value is always used, even if the PRINTER variable is also set.
  • If the PRINTER variable is set and no LPDEST variable is set, then lpr uses the value specified by the PRINTER environment variable.
    Note: Any destination command line options override both the LPDEST and the PRINTER environment variables.
-r Removes the file upon completion of spooling.
-s Prints from the files specified on the command line rather than trying to copy them (so large files can be printed). This means the data files should not be modified or removed until they have been printed. Note that this flag only works on the local host (files sent to remote printer hosts are copied anyway), and only with named data files. It does not work if the lpr command is at the end of a pipeline.
-T Title Uses the Title variable instead of the file name for the title used by the pr command.
-w Number Uses the Number variable as the page width for the pr command.

Examples

  1. To print three copies of the files new.index.c, print.index.c, and more.c, enter:
    lpr -#3 new.index.c print.index.c more.c
    Prints three copies of the new.index.c file, three copies of the print.index.c file, and three copies of the more.c file.
  2. To print three copies of the concatenation of three files new.index.c, print.index.c, and more.c, enter:
    cat new.index.c print.index.c more.c | lpr -#3
  3. To print Operations on the burst page, followed by file new.index.c, enter:
    lpr -C Operations new.index.c
    This replaces the system name (the name returned by host name) with Operations on the burst page.
  4. To queue the MyFile file and return the job number, enter:
    lpr -j MyFile

Files

/usr/sbin/qdaemon Queuing daemon.
/etc/qconfig Queue configuration file.
/etc/qconfig.bin Digested, binary version of the /etc/qconfig file.
/var/spool/lpd/qdir/* Queue requests.
/var/spool/lpd/stat/* Information on the status of the queues.
/var/spool/qdaemon Temporary copies of enqueued files.

Related Information

The lpd command, lpq command, lprm command, pr command, qdaemon command.

The qconfig file.

Starting a Print Job in AIX Version 4.3 System User's Guide: Operating System and Devices.

Printers, Print Jobs and Queues Overview for Users in AIX Version 4.3 System User's Guide: Operating System and Devices.

Printer Overview for System Management in the AIX Version 4.3 Guide to Printers and Printing.

Spooler Overview for System Management in the AIX Version 4.3 Guide to Printers and Printing.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]