|
|
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 -sTo select one of the available printers, use the lp -d option, as follows:
$ lp -dlaserwriter2 file1 file2 file3This 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 LPDESTpostscript-2 will then become your default printer next time you log in.