Basic UNIX Print Commands

In what follows below, 'laptop' refers to an SNS supplied laptop computer.

Refer to this section of the CUPS (Common Unix Print System) manual to learn more about the options to the lpr command described below.

To print a postscript document:

lpr filename.ps

To print a text document:

a2ps filename.txt

To specify single/double sided printing:

Monochrome printers print double-sided by default.
Color printers print single-sided by default.

To force single-sided printing e.g.
lpr -o sides=one-sided filename.ps

To force double-sided printing e.g.
lpr -o sides=two-sided-long-edge filename.ps
or alternatively
lpr -o sides=two-sided-short-edge filename.ps

Optionally from a desktop computer ....

You may specify single-sided printing or double-sided (duplex) printing by printing to the appropriate queue.
Each printer has three queues:   printer, printers, and printerd.
For example, you may print duplex (the default) by printing to bw4.
You may print one-sided by printing to bw4s.
You may specify duplex (the default in this case) by printing to bw4d.

To print more pages per side

To print more than one page per side, e.g.
lpr -o number-up=4 filename.ps
which prints 4 pages per side.

Optionally from a desktop computer ....

Use the 2up(d) or 4up(d) commands.

2up filename.ps which prints 2 pages per side to your default printer.

4upd filename.ps col3 which prints 4 pages per side & double-sided to print queue col3.

To print a transparency (not from laptops, color printers only):

All color printers have an additional queue: printert which can be specified to print a transparency.
For example, you may print a transparency by printing to col3t.

To find out what your current default printer is:

lpstat -d

To view available print queues:

lpstat -a

To change your default printer:

Edit your   ~/.cshrc or   ~/.bashrc file and change the LPDEST and PRINTER lines to indicate the new printer.
Log out and back in for the change to take effect.

To display the print queue:

lpstat  [printername]
The command without printername option will list your default printer queue.
To display queue of a printer other than your default indicate the printername.

To cancel a print job:

Get the job-id from the output of lpstat command.
cancel  job-id

Example:

pr163[1] lpr testfile.ps
pr163[2] lpstat bw2
bw2-552                 cooper         1929216   Wed Nov 27 13:37:04 2002
pr163[3] cancel bw2-552