Dept of Computer Science

Technical Staff

How do I send files to the printers?

Last updated: January 22nd, 2015 03:29 PM

For general printing of text and PostScript files there is the standard UNIX lpr command and there is the Adobe enscript command.

The lpr command will print both text and PostScript files with limited formatting and control options. You must specify which printer to send your output to. The syntax is: lpr -Pprinter filename where printer is the name of the printer to send your output and filename is the name of the file you would like to print.

The enscript command, on the other hand, converts text files to POSTSCRIPT language format for printing. It will perform the conversion according to the command line options specified (see the man page) and spool the file for printing in one operation. Here again, you must use the -P option to specify the printer you want to use. Enscript has many options including page numbers, page headings, two column output, landscape mode printing, and more. See the man page for more information.

If the -P option is not specified, both commands will look to the PRINTER environment variable set for your shell and try to send the output to this printer. The command 'printenv PRINTER' will display the value for this variable. The command 'setenv PRINTER mib' will set the value of this variable to "mib". The setenv command is typically set in the .cshrc file located in each user's home directory.

Note that compressed files must be uncompressed before they can be printed. Photo image files may be printed only from a web browser or photo editing program. Printing a compressed file or a photo image file will jam the print spooler and hold up subsequent processing. If you suspect this has happened, send e-mail to the tech staff. Compressed files can be recognized by a .z, .Z, .gz, .zip, .gzip, .tar, .rar, or .bz2 suffix. Photo image files can be recognized by a .jpg, .gif, .tif, or .targa suffix.

To use the printers under Windows you must have the printers installed on your workstation.  Send an e-mail to to request that a printer be installed on your workstation.