Developer's Daily Unix by Example
  main | java | perl | unix | DevDirectory
   
Main
Unix
Education
Unix by Example
   

 

Command lp
Description "lp" is the command used to print files. "lp" stands for line printer. As with most Unix commands there are a fairly large number of options available to enable flexible printing capabilities.
Examples lp /etc/passwd

This command prints the "/etc/passwd" file to the default printer. If you do not use the "-d" option, the file is printed to the default printer destination.

lp -dSales .profile

This command prints the ".profile" file to the printer named "Sales". The -d option specifies the destination.

lp -dSales file1 file2 file3

This command prints the three files "file1", "file2", and "file3" to the printer named "Sales".

lp -i Sales-101 -H hold

This command places the print request Sales-101 on hold.

lp -i Sales-101 -H resume

This command resumes the print request Sales-101. The print request starts printing from page one unless you instruct it otherwise.

lp -i Sales-101 -H resume -P 4-

This command resumes the print request Sales-101, starting with page 4 of the print job. Note that the final hyphen (following the "4") is required.

The "lp" command can also be used as part of a pipeline. For instance, the following command will print the output of the "ps -ef" command to the default printer:

ps -ef | lp

Print the output of the "ps -ef" command to the default printer.

 


What's related

copyright 1998-2007, devdaily.com, all rights reserved.
devdaily.com, an alvin j. alexander production.