Sending a job to a printer (lpr)
Previewing files before you print
Before you send a job to a printer, check the file carefully
to make sure that it is ready to print. To display a plain
text file (ASCII), you can can use these commands:
- more filename
- less filename
You can also use an editor such as NEDIT or PICO. To view
another type of file, use the previewing feature of the application
that created it.
Printing from an application
In most X Window/Motif applications, select Print from
the File pulldown menu. If there is also
a Print... option, you can select it to
change print settings, e.g., number of copies and range of
pages.
Printing from the command line
On UNIX/Linux machines, the file you wish to print is a "PostScript" file
with a .ps extension. To print a file that has been formatted
for printing, type lpr (line print) followed by the file
name or the path to the file, e.g., lpr filename.ps or lpr
dir/filename.ps.
The workstation you use will automatically route your files
to a particular printer, usually a local one in your office
or lab (see list at http://print.ncsu.edu/listofprinters.php) .
However, you can route print jobs to other printers by either
(1) selecting the printer you want from the Printer options
available inside the application, or (2) printing to a file
and then sending the file to the printer you specify. The
latter is done by adding -P after the lpr command followed
immediately (no space) by the name of the printer you want
to use (see list at left) and the print-formatted file you
want to print. For example, if you want to print to the printer
in 242 Daniels, you would specify that printer's name and
the file you want to print, e.g., lpr -Pdan242 file.ps.
To see what print jobs are queued for the printer, type
lpq. To remove a print job before it prints, type lprm job#.
You can only remove your own print jobs. On UNIX, the default
printer is set in the PRINTER environment variable. To find
out your default printer, type printenv PRINTER. You can
change the default printer by typing setenv PRINTER followed
by the name of the printer you want to use. When you want
to specify a printer other than the default, use the -P option
(see above) to override the default setting in your environment.
You can use this
list to find out where each printer on the
network is located. This can be especially handy if the
default printer is very busy.
Changing the default printer
To find out your default printer, type
printenv PRINTER
To change it, type
setenv PRINTER followed by the name of
the printer you want to use as the default.
Using the -P option will always override
the default setting.
Go to the Print tutor
main page.
Last modified on
August 19, 2004
by cawalker. |