|
|
|
|
There are several ways in which to print a file to obtain a hard copy; which one you use depends upon what type of file you wish to print.
To print a plain text file, use one of the following commands (replace "filename" with the name of the file you wish to print):
lpr filename
prt filename
prtl filename
The "lpr" command will simply print the text file, as is, on the default printer. Unless you specify options to "lpr", no header or pagination information will be added to the output. There are several options which can be used with "lpr"; see the man page for explanations of the options.
The "prt" command adds some headers and formatting to the output. By default, it will split the output into pages; each page will have a fancy header containing the name and path of the file, the date and time it was printed, the date and time of the last modification of the file, and the name of the machine from which the file was printed. Some useful options which can be used with "prt" include:
| -1 | portrait orientation with one 90-char-wide column. |
| -2 | landscape orientation with two 88-char-wide columns. |
| -L | landscape orientation with one 209-char-wide column. |
| -l | landscape orientation with one 156-char-wide column. |
For example,
prt -l myfile.txt
will print the file "myfile.txt" in landscape orientation on the page with one 156-character-wide column. Unless told otherwise through the use of options, "prt" will print a short file (one which is less than a single page) in portrait orientation with a 90 character column (the equivalent of the "-1" option), or a file longer than a single page in landscape orientation with two 88 character columns (the equivalent of the "-2" option). Typing
prt -h
will display a short description of the command and its option to your terminal or window.
The "prtl" command is a line-printer emulator. It emulates a 132 character wide line-printer using landscape orientation on an 8 1/2" by 11" sheet of paper. If invoked with the option "-c", it will interpret the first column of each line of the input file as FORTRAN carriage control.
If the file you wish to print is a PostScript file, it is also printed using the "lpr" command. Software which controls the printer will realize that the file is PostScript page definition commands, and will print it accordingly. Do not use the "prt" command to send PostScript files to the printer -- PostScript files actually contain plain-text, so "prt" will print them as such, producing a large number of pages of PostScript commands rather than the plot or word-processor formatted output that you expect!
Unless you specify otherwise, your printed output will be sent to your default printer; the default printer is specified by the environmental variable PRINTER. To see what your default printer is, issue the command
echo $PRINTER
This will display a printer name, such as "earthlaser". If you do not know where that printer is physically located, you can find out by typing
printer_loc earthlaser
substituting whichever printer you are interested in for "earthlaser". This will return the location:
The printer earthlaser is located in 203 Deike Building
If you don't know where a particular building is located, you can check the main campus visitor's map.
Typing the command "printer_loc" without any arguments will return a list of all printers and their locations, which may be useful in helping you set your default printer to one close to your workstation.
If you want to change your default printer, issue the command:
setenv PRINTER printername
substituting the name of the printer of your choice for "printername". You may peruse the "printer_loc" output to see what printers are available (see above). If you want to have your default printer defined automatically every time that you log into the Suns, add the setenv command to the file ".login.cat" in your home directory using your favorite text editor.
You may also override the default printer and send your output to a different location by using an option with either the "prt" or "lpr" commands. The "-P" option is used to specify which printer to send output to for a single instance of a printing command. For example,
lpr -Pwalkerlaser myfile
will print the file "myfile" to the printer named "walkerlaser". "prt" and "prtl" also accepts the "-P" option.
To check on a print job, issue the command
lpq
By default, this will return the status of the default printer defined by the environmental variable PRINTER. The "lpq" command also accepts the "-P" option if you want to specify a printer other than your default printer.
The output of "lpq" will look like the following:
carbon:buechler[92]% lpq earthlaser is ready and printing Rank Owner Job Files Total Size active buechler 285 94-04-12.list.addendum 4188 bytes 1st buechler 286 94-04-12.list 4188 bytes carbon:buechler[93]%
In this example, there are two jobs in the print queue for printer "earthlaser". Job number 285 is currently printing, and job number 286 will be the next to print. The owner of the job, name of the file being printed, and its size are also listed.
The number under the "Job" heading is the job number. If you wish to remove a print job that is in the print queue, you may do so by entering the command
lprm jobnumber
where "jobnumber" is replaced by the number of the print job.
To print a color postscript file as a transparency on the printer "hue", use the command:
prtrans -Phue filename.ps
Also check out the color printing page.