The lpr command includes information for the AIX® Print Subsystem lpr and the System V Print Subsystem lpr.
AIX Print Subsystem lpr Command
Enqueues print jobs.
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 ... ]
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.
Item | Description |
---|---|
-# 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 that 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. Usually, the lpr command uses the name of the first file. |
-l | (Lowercase L) Uses a filter that allows control characters to be printed. |
-m | Sends mail upon completion of spooling. |
-n | Uses a filter that 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). |
-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. |
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.cat new.index.c print.index.c more.c | lpr -#3
lpr -C Operations new.index.c
This replaces the system name (the name returned by host name) with Operations on the burst page.lpr -j MyFile
Item | Description |
---|---|
/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. |
The lpd command, lpq command, lprm command, pr command, qdaemon command.
The qconfig file.
Command for starting a print job (qprt command) in AIX Version 7.1 Operating system and device management.
Printers, print jobs, and queues in AIX Version 7.1 Operating system and device management.
Printing administration in the AIX Version 7.1 Printers and printing.
Print spooler in the AIX Version 7.1 Printers and printing.
System V Print Subsystem lpr Command
(BSD) Sends a job to the printer.
/usr/bin/lpr [ -P printer] [ -# copies] [ -C class] [ -J job] [ -T title] [ -i [indent] ] [ -w cols] [ -r] [ -m] [ -h] [ -s] [ -filter_option] [file ... ]
The lpr command forwards printer jobs to a spooling area for subsequent printing as facilities become available. Each printer job consists of copies of each file you specify. The spool area is managed by the line printer spooler, lpsched. lpr reads from the standard input if no files are specified.
lp is the preferred interface.
lpr -fs
lpr -f -s
Placing the -s flag first, or writing each option as a separate argument, makes a link as expected.
lpr -p is not precisely equivalent to pr | lpr. lpr -p puts the current date at the top of each page, rather than the date last modified.
Fonts for troff and T[E]X reside on the printer host. It is not possible to use local font libraries.
lpr objects to printing binary files.
If userA uses su to become userB and uses /usr/bin/lpr, then the printer request will be entered as userB, not userA
lpr -#3 index.c lookup.c
cat index.c lookup.c | lpr -#3
generates three copies of the concatenation of the files.
lpr -C Operations new.index.c
replaces the system name (the name returned by ``hostname'') with Operations on the burst page, and prints the file new.index.c.
If no filter_option is given (and the printer can interpret PostScript), the string `%!' as the first two characters of a file indicates that it contains PostScript commands.
These filter options offer a standard user interface, and all options may not be available for, nor applicable to, all printers.
/usr/etc/lpc disable printer
to prevent lpr from putting files in the queue. This is usually done by the system manager when a printer is going to be down for a long time. The printer can be turned back on by a privileged user with lpc.