Go to the previous, next section.

lpr

The command for printing a file to a printer is lpr. To print a file called `foo' to the default printer (lp1 on most machines):

lpr foo

If you want to print the file to a different printer, say `lw3', use

lpr -Plw3 foo

The general syntax is lpr -Pprinter file where printer is one of the valid printers on our machines. A list of printers is shown in See section Printers in the CS Department.

If you normally print to a different printer than the default, you can take advantage of the environment variable PRINTER. For instance, if you normally print to the lw3 printer, you can type the following line:

setenv PRINTER lw3

and from now until you log out, your default printer will be lw3. Therefore, when you use lpr without the -P option, it will send the file to the `lw3' printer. Of course, you can still use -Pprinter to make it go to a different printer.

If you put the above line in your .cshrc, it will set your default printer every time you log in, so you won't have to type it each time. lpr, lpq, and lprm all use the PRINTER variable.

Go to the previous, next section.