Sends requests to a line printer.
lp [ -c ] [ -dQueue ] [ -m ] [ -nNumber ] [ -oOption ] [ -s ] [ -tTitle ] [ -w ] [ Files ]
The lp command arranges for the files specified by the Files parameter and their associated information (called a request) to be printed by a line printer. If you do not specify a value for the Files parameter, the lp command accepts standard input. The file name - (dash) represents standard input and can be specified on the command line in addition to files. The lp command sends the requests in the order specified. If the job is submitted to a local print queue, the lp command displays the following to standard output:
Job number is: nnn
where nnn is the assigned job number. To suppress the job number use the -s flag.
|-c||Copies the files to be printed immediately when the lp command is run. The lp command copies files only when requested. No links are created. If you specify the -c flag, be careful not to remove any of the files before they are printed. If you do not specify the -c flag, changes made to the files after the request is made appear in the printed output.|
|-dQueue||Specifies the print queue to which a job is sent.|
|-m||Sends mail (see the mail command ) after the files are printed. By default, no mail is sent upon normal completion of the print request.|
|-nNumber||Prints the number of copies of printed output. The default number of copies is 1.|
|-oOption||Specifies that flags specific to the backend be passed to the backend. Thus, for each queue, other flags not described in this article can be included with the lp command. See the piobe command for a list of these flags. Specifying this flag is the same as specifying the -o flag for the enq command.|
|-s||Suppresses the automatic return of job numbers. The lp command reports the job number as the default, the -s flag overrides the default.|
|-tTitle||Specifies printing the title of the file on the banner page of the output.|
|-w||Writes a message on the print requester's terminal after the files are printed. If the requestor is not logged in, the mail command sends the message. If the user is logged in on multiple windows or terminals, the message may not be sent to the LFT where the command was issued. The message is sent to the first terminal on which the writesrv daemon sees the user to be logged in.|
lp -c -m -n30 -dlp0:lpd0 /etc/motd
lp -t"blah" -o -f -o -a /etc/motd
lp -s myfile
This command returns the following exit values:
|0||All input files processed successfully.|
|>0||No output device is available, or an error occurred.|
|Contains the queuing daemon.|
|/var/spool/lpd/qdir/*||Contains the queue requests.|
|/var/spool/lpd/stat/*||Contains information on the status of the devices.|
|/var/spool/qdaemon/*||Contains temporary copies of enqueued files.|
|/etc/qconfig||Contains the queue configuration file.|
|/etc/qconfig.bin||Contains digested, binary version of the /etc/qconfig file.|
The cancel command, enable command, lpr command, lpstat command, mail command.
The writesrv daemon.
The /etc/qconfig file.
Starting a Print Job 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.
Printers, Print Jobs, and Queues Overview for Users in AIX Version 4.3 System User's Guide: Operating System and Devices.
Spooler Overview for System Management in AIX Version 4.3 Guide to Printers and Printing.