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.
|