Research Computing >> Hardware >> skew3 >> Printing from skew3

PRINTING FROM SKEW3

Contents:


Configured printers

The following printers have been configured in skew3:

  • acc_phd?*)
  • lp (AIM TekTronic printer)
  • fin_400
  • mkt_phd2
  • ms_611
  • ms_632b
  • ms_phaser
  • ms_phaser2
  • morsphd-lab

(*) not Postscript compatible (not able to print .ps files). Enscript does not work.

Printing: "lp" command

The basic Unix printing command is lp. To Print from skew3 you must specify the printer. This can be done with the "-d" option:

lp -dprinter_name filename

where "filename" is the name of the file to be printer and "printer_name" is one of the printer queues listed below. For example, to print a file called "test.txt" in the ms_phd printer queue, the command would look as follows:

lp -dms_phaser test.txt

Another command to print is "enscript", which allows the user to customize the printout's format.

Cancelling a job

Many times you may want to cancel a job you sent to the printer because it is too long or you printed the wrong file. This is easy to accomplish if you know the printer you printed to and the id of your job. If you are not sure what id your particular job is, you can list the jobs at that printer by executing:

$ lpstat ms_phaser
printer queue for ms_phaser
ms_phaser is ready and printing

jgu853: active [job 22 skew3.kellogg.northwestern.edu]
standard input 24873 bytes

skew3: ms_phaser: ready and waiting

The output from lpstat tells us a lot about what's happening in the printer. The job that is active at this time belongs to a user called and the job id is 22 and was sent from lurk.kellogg.northwestern.edu. The file size is also show (24873 bytes). Using this program you can find the job id and other information concerning the job you want to stop. Notice that unless you are jgu853 you are not allowed to delete the job from the printer's queue. Only the system administrator can modify the printer queue for other users. But lets say you are jgu853 and you want to remove your file. This is done by a program called cancel. The format is cancel <job id> <printer id>. So for example, to delete this job run the cancel program with these options:

$ cancel 22 ms_phaser

This will remove the file from the printer's queue and allow the printer to start printing other jobs.

lp options

Many options are available to customize each print job. You may print different number of copies and also be notified when your request has been fulfilled by the printer so you can go pick it up.


-m -- send email to user when finished.
-w -- write message to user's terminal when finished.
-nx -- print file x number of times.

For example:

$ lp -w -n5 -dms_phaser myfile.ps

This string of commands tells lp to print 5 copies of the myfile.ps to kis_j4222's printer.

Relevant links:

Enscript

Enscript converts plain text files to PostScript and sends the generated PostScript output to the specified printer or to a file. It has many options which can be used to customize printouts, including 2-up printing, pagination, complex headers, and many more.

The print with enscript issue the following command:

enscript [options] filename

For example to print a file called "test.txt" to fin_400:

enscript -d fin_400 filename

Useful options:

  • 2-up printing (-U2)
  • Landscape (-r, "rotate')
  • "Gaudy" header (-G). By default, the header will have the file's date and time stamp, the file's name and the page number
  • Printer device (-d printer_name)
  • Number of columns (-2, -3, etc)

These options can be combined in one command. To print a text file (for example, the output of a SAS session or a Fortran program), landscape, with two columns and a header, issue the following command:

enscript -G2rd printer_name filename

Relevant links:

Configuring a default printer

To save some typing, users can select a default printer for all their sessions. This is done by specifying the LPDEST environment variable in the shell's configuration files. Configuring a default printer allows usage of "lp" and "esncript" without specifying a printer destination.

Korn and bash shell users should edit their .profile file and include the following line:

LPDEST=printer_name; export LPDEST

Csh and tcsh users should include the following line:

setenv LPDEST printer_name

If the user has a specific set of options used frequently (for example, using enscript with the Gaudy and rotated options, "enscript -G2r"), an appropriate alias may be created in the shell's configuration files. For example, for a C shell configuration file (.cshrc):

alias print enscript -2rGd fin_400

Once the alias is effective (next login or after a "source" command), the command "print filename" would use enscript with the options specified in the alias.

© 2001-2008 Kellogg School of Management, Northwestern University