Printing from a Public Unix system at LEPP


This page contains instructions on printing from a public unix system at LEPP using LPR. All of LEPP's printers should be already listed known to your system, so to print you need only specify the file and printer to use.

The $PRINTER environment variable

  • You may specify a default printer by setting the $PRINTER environment variable.
    ex. If you are using bash and want lt104_hp_8000 to be your default printer, add export PRINTER=lt104_hp_8000 to your .bash_profile file.
    If you are using tcsh, you would add set PRINTER=lt104_hp_8000 to your .login file.
  • You may also change your default printer using the above commands from a terminal. However, any changes to your PRINTER environment variable only effect the terminal they are made from (and applications started from that terminal).

Printing from the command line

PLEASE NOTE LPR assumes that all non-postscript files are standard text. Therefore, attempting to print a file from the command line that is neither text nor postscript will result in many pages of garbage.
  • Type lpr file where file is the text or postscript file you would like to print. Alternatively, if you would like to specify which printer to use, type lpr -P printer file where printer is your desired printer. Please see /etc/printcap or PrinterList for the correct printer (or queue) name. For information on your printcap file, see man printcap.
    ex. To print the file test to lt104_hp_8000, I would type: lpr -P lt104_hp_8000 test

Printing from an X application

Most application files (such as OpenOffice documents) are not in postscript and may not be printed from the command line. However, when printing from X applications, the postscript conversion is done for you. Therefore, to print OpenOffice documents or web pages, you must print from their respective X application.
  • Click on the File menu item and choose Print
  • The Print window should appear. If you have set your $PRINTER variable, you can just click on Print to print to your default printer.
  • If you would like to specify the printer to use, look for a text area labeled Command or Print Command. Clear that text area and enter lpr -P printer. If there is no Command text area, click on Properties and enter lpr -P printer in the Command text area of the window that appears. Again, please see /etc/printcap or PrinterList for the correct printer name.
  • If you wish to change your default printer before starting the X application, please note that you must start the application from the terminal you used to change your default printer. Any changes to your PRINTER environment variable only effect the terminal they are made from (and applications started from that terminal). Alternatively, from the X application's print window you may choose Print to File to save a postscript version of your current document. You may then print this postscript file from the command line as outlined above.

-- CurtisJastremsky - 25 Oct 2006

This topic: Computing > WebHome > PrintingAtCLASSE > PrintingFromUnix
Topic revision: 07 May 2013, DevinBougie
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CLASSE Wiki? Send feedback