Personal tools
You are here: Home PopNet Help: Using PRI's Networks Unix/Linux Unix Printing

Unix Printing

Help on how to print from a unix host.

What printers can I print to and what are they called?

There are many printers on the PopNet. Many are public printers, available from any workstation on the network, and many are local printers, available only from the workstation to which they are attached. To get a list of printers that you can print from the workstation you are logged on, type:

lpc status

This also lists other information about the printers which may be different from computer to computer. The first name is usually a brief description of what and where the printer is.

How to Print Something

To print a file, you use the lpr command. NOTE: You can only print certain kinds of files with lpr. You can not use lpr to print files such as WordPerfect documents, Lotus spreadsheets, and the like. You must use the file's respective application to print it.

To print a file, type:

lpr -Pprintername filename

For example:

  • lpr -Plj806 my.lst
    Prints "my.lst" to lj806
  • lpr big.lst
    Prints "big.lst" to the default printer
  • lpr -Plp806b my.lst my.log my.sas
    Prints those three files to lp806b

If you do not specify a printer when using the lpr command, it will go to the default printer. The default printer can vary from workstation to workstation on the network. To see what it is, type:

lpstat -d

It will return the name of the default printer, or something like /dev/ttyb. In this case, the default printer is the printer connected to the workstation.

Viewing queued print jobs

To get a list of jobs waiting to print on a particular printer, type:

lpq -Pprintername

For example:

  • lpq -Plj806
    lists queue for lj806
  • lpq
    lists queue for default printer

Cancelling a print job

If a job is in the queue and you wish to cancel it, then type:

lprm -P printername jobnumber

For example:

  • lprm -P lj806 87
    remove job number 87 from lj806
  • lprm -P lj806 6 7 8
    remove jobs 6, 7, and 8 from lj806
  • lprm 3
    remove job 3 from default printer

Printing more than one "page" on each sheet of paper

On any unix machine, you can use either the enscript command or the mpage command. Note that enscript generally provides "prettier" formatting options, while mpage allows greater page condensation (more "pages" per sheet).

For example:

  • enscript -G2jrE -Plj806 sasprogram.sas
  • mpage -2 -Plj806 sasprogram.sas

Changing your default printer

lpr, lpq, lprm, and several other programs can look at an environment variable called PRINTER to tell it what default printer to use. To use this setting, type:

setenv PRINTER printername

For example:

setenv PRINTER lj501

You can verify the new default destination by typing lpstat -d.

This will only affect programs typed at this prompt. To set it permanently, put the setenv command you typed above at the end the file called .login in your home directory. Then log out and log back in. Verify the change by typing lpstat -d.

Printing to the color printer

There's a color printer in the computer lab, attached to a PC. To print from it, transfer the file you wish to print to the PC, open it in the appropriate application, and then print from that application.

If you have a color print job requiring greater quality and it is for a PRI approved project, the GIA core may be willing to grant access to its color laser printer, provided you cover expenses.

Please contact a staff member for assistance regarding this or any printing questions.

Printing from SAS

Below are instructions on how to print to the 806 lab printer from Unix SAS:

  • Start SAS
  • Under the File menu, select Printer Setup
  • Name: lj806
  • Description: HP LaserJet 9000 (806 Oswald Tower)
  • Click Next
  • PostScript Level 1 (Gray Scale)
  • Click Next
  • Device type: printer
  • Destination: lj806
  • Click Next
  • Click Finish
  • Click ok
Document Actions

Copyright ©2014, The Pennsylvania State University | Privacy and Legal Statements
Contact the Help Site Administrator | Last modified Aug 13, 2008 | Weblion Partner