Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
 

What's inside.

Account Management

CSE Wiki

E-mail

Hardware and Media

Network and Wireless

Offsite Access

Printing

Processes

Security and Passwords

Software and Tools

Systems Staff

Web Development

 

Help Home

CSE Home

 
 
 
 
 

 
  Home > Printing > Unix Printing

Unix Printing


How do I print from Unix?

Use lpr or mpage at the command line to print postscript (.ps) and text files. Neither lpr nor mpage will print PDFs, .doc files, or other application documents correctly. In most cases, garbled code will be printed instead of the text or pictures intended. Use the application which created the document to print a postscript file before printing.

"mpage" will allow you to print multiple pages on each sheet of paper and provides additional formatting options. It defaults to 4 pages/sheet. More mpage formatting options can be found by typing "man mpage" at the command line. Note that several options for mpage (including -P) do not permit a space between the option and its argument.

Usage:

lpr -P <printer name> <filename>
mpage -<# pages/sheet> -P<printer name> <filename>

Examples:

lpr -P printer1 myDoc.ps
mpage -2 -Pprinter1 csciNotes.ps

How do I print on just one side or both sides of the page?

Black and White

Black and white printers print duplex (double-sided) by default. In most cases, to print simplex (single-sided) pages you need to append '-simplex' to the end of the printer name.

Usage:

lpr -P <printer name>-simplex <filename>
mpage -<# pages/sheet> -P<printer name>-simplex <filename>

Example:

lpr -P printer1-simplex myDoc.ps
mpage -4 -Pprinter1-simplex csciNotes.ps

If you are printing to one of the Xerox 3450s and the above command does not work, use:

lpr -Z simplex -P <printer name> <filename>

Color

Color printers print simplex (single-sided) by default. To print duplex (double-sided) append '-duplex' to the end of the printer name.

Example:

lpr -P <printer name>-duplex <filename>

How do I cancel a print job under Unix?

lpq -P <printer name>

This will produce output that similar to the following:

Printer: grad is grad-queue@printhost
Printer: grad-queue@augustus-239  'HP LaserJet'
 Queue: 1 printable job
 Server: pid 4030 active
 Unspooler: pid 4045 active
 Status: printing 'username@mega+244', file 1 '/etc/motd'
 Filter_status: sending job
 Rank     Owner/ID              Class     Job   Files           Size Time
active   username@mega+244        A       244   /etc/motd         54 09:14:39

Find the Job Number. (In this example, it is 244.)

lprm -P <printer name> <Job Number>

How do I change my default printer?

Unless a default printer has been set for your account, most Linux and Unix applications will default to the printer "grad", located in EE/CS 2-216 (the Grad Lab).

To set a default printer, you need to modify the shell configuration file in your UNIX home directory. This will most often be your '.cshrc' file.

Just add the following line to your .cshrc file. Then log out and log back in.

setenv PRINTER <printer name>

Tip:

To set a different default printer on different machines, you can add tests of this format to the configuration files:

if ( `uname -n` == <host1>) then
    setenv PRINTER <printer1>
else
    setenv PRINTER <printer2>
endif
 
The University of Minnesota is an equal opportunity educator and employer.
CSE Online Help