- lp/
lpr
These commands are used in order to submit a print
request to a printer on the Chemistry network. To use these
commands, you must have your UNIX machine set up to print to
printers on the Chemistry network. Email
Chemistry Computer Support if you need help setting
up a printer on your UNIX machine.
To print a file by the name of text.out to your default
printer, type the following from the prompt:
lp text.out
lpr text.out
If you have multiple printers set up, and you would like
to print to a printer other than your default printer (say,
the Tektonix Phaser color printer in the computer lab), type the following
from the prompt:
lp -d 2105nw_phaser text.out
(note the space after the -d)
lpr -P2105nw_phaser text.out
(note that there is no space after the -P)
The -d stands for "destination", the -P means "Printer".
- lpstat/
lpq
These commands display the contents of a print queue.
To use these commands for your default printer, type the
following from the prompt:
lpstat
lpq
If you would like to check the queue of a printer other than your
default printer, type the following from the prompt:
lpstat -o
lpq -P2105nw_phaser
The first example will give you the status of all print jobs. Note that the
command lpstat -d 2105nw_phaser will
show you the default queue rather than a destination; there is not always a
logical correspondence between System V and
BSD commands.
The output of the above commands will give you the number of your print job (also
called the request ID).
If you wish to terminate the job, you need to know this number.
- cancel/
lprm
These commands remove print requests from the print queue.
If you want to terminate a print job, USE THE COMMANDS ABOVE!
Do not turn the printer off and back on, or attempt to
alter its settings. To use these commands,
assuming your job number is 2241 to the default printer,
type the following from the prompt:
lprm 2241
To remove job 469 from the color printer, you would type:
cancel 2105nw_phaser-2241
lprm -P2105nw_phaser 2241
Note that removing print jobs can be a lot more complicated because of
the shared nature of our printer queues. It may not always be possible for
you to remove a print job in this way. In general, you should try to remove
a print job on the computer you submitted it from. Also, there are many
variations even between computers of the same type (System V or BSD) and
additional subtleties that can be very complicated.
If we have not answered your questions here, there
are several other sources of information on printing
in UNIX. Typing "man" followed by the name of the command
will show you online manual pages related to that command for the computer
you are working on. This is the most important source of information.