.
Uranium Sulfur Oxygen Department of Chemistry The Ohio State University Department of Chemistry Department of Chemistry The Ohio State University I go round and round Department of Chemistry The Ohio State University return to the chemistry home page return to the chemistry home page return to the main graduate page return to the chemistry home page return to the main internal resources page return to the chemistry home page return to internal resources page return to the computer support page return to the chemistry home page return to the main undergraduate page

     

blank How do I print from a UNIX machine?
There are two basic types of UNIX: System V UNIX, of which our main chemistry server (Sun Solaris) is an example, and BSD UNIX. Other System V UNIX machines are SGIs running IRIX. Examples of BSD type UNIX are Suns running the older SunOS, Linux boxes, and IBM machines running AIX. Often what type of machine you have will determine what set of printing commands to use. In some cases, UNIX machines may be set up for either System V or BSD printing (as is the case for the chemistry Unix server), but this is not always the case. The following commands will display
System V commands in red, then
BSD commands in blue.
  • lp/ lpr

  • These commands are used in order to submit a print request to a printer on the Chemistry network. To use these commands, you must have your UNIX machine set up to print to printers on the Chemistry network. Email Chemistry Computer Support if you need help setting up a printer on your UNIX machine.

    To print a file by the name of text.out to your default printer, type the following from the prompt:
    lp   text.out
    lpr   text.out

    If you have multiple printers set up, and you would like to print to a printer other than your default printer (say, the Tektonix Phaser color printer in the computer lab), type the following from the prompt:
    lp   -d   2105nw_phaser text.out      (note the space after the -d)
    lpr   -P2105nw_phaser text.out      (note that there is no space after the -P)

    The -d stands for "destination", the -P means "Printer".

  • lpstat/ lpq

  • These commands display the contents of a print queue. To use these commands for your default printer, type the following from the prompt:
    lpstat
    lpq

    If you would like to check the queue of a printer other than your default printer, type the following from the prompt:
    lpstat   -o
    lpq   -P2105nw_phaser

    The first example will give you the status of all print jobs. Note that the command lpstat   -d   2105nw_phaser will show you the default queue rather than a destination; there is not always a logical correspondence between System V and BSD commands.

    The output of the above commands will give you the number of your print job (also called the request ID). If you wish to terminate the job, you need to know this number.

  • cancel/ lprm

  • These commands remove print requests from the print queue. If you want to terminate a print job, USE THE COMMANDS ABOVE! Do not turn the printer off and back on, or attempt to alter its settings. To use these commands, assuming your job number is 2241 to the default printer, type the following from the prompt:
    lprm   2241

    To remove job 469 from the color printer, you would type:
    cancel   2105nw_phaser-2241
    lprm   -P2105nw_phaser   2241

    Note that removing print jobs can be a lot more complicated because of the shared nature of our printer queues. It may not always be possible for you to remove a print job in this way. In general, you should try to remove a print job on the computer you submitted it from. Also, there are many variations even between computers of the same type (System V or BSD) and additional subtleties that can be very complicated.

If we have not answered your questions here, there are several other sources of information on printing in UNIX. Typing "man" followed by the name of the command will show you online manual pages related to that command for the computer you are working on. This is the most important source of information.

We would highly recommend the Linux Printing HOWTO if you would like to learn even more about printing on Linux and other BSD UNIX machines.

Contact Information:
Department of Chemistry
The Ohio State University
100 W. 18th Avenue
Columbus, Ohio 43210
phone: (614) 292-2251
fax: (614) 292-1685
Contact Us

If you have trouble accessing this page and need to request an alternate format,
please contact Michael Reed at mreed@chemistry.ohio-state.edu

© 2005, All rights reserved, The Ohio State University, Department of Chemistry