DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Working with files and directories

Selecting a printer

If you know that several printers are connected to your system, and you want to send a file to a printer that is not busy, you need to know the destination printer's name. You can get a list of the printers available to you by using the lpstat(C) (line printer status) command, as follows:

   $ lpstat -s
To select one of the available printers, use the lp -d option, as follows:
   $ lp -dlaserwriter2 file1 file2 file3
This command line sends the specified files to the named printer.

You can assign a default printer for lp to use, by setting the LPDEST environment variable. Environment variables are explained in depth in ``Setting shell variables''. Add a line setting the value of LPDEST to the name of your default printer to the appropriate login script. (Login scripts are described in ``What happens when you log in''.)

For example, if you are using the Korn shell and the printer you want to use by default is called postscript-2, you can add the following line to your .profile file:

   LPDEST=postscript-2; export LPDEST
postscript-2 will then become your default printer next time you log in.
Next topic: Displaying a list of current print jobs
Previous topic: Printing several copies of a file

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005