Prev | Current Page 1081 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"


As a regular user, you can override the default printer using the PRINTER environment variable. If
the default printer on your computer is lp0, for example, and you want to print regularly to lp1,
change your default printer by setting the PRINTER variable as follows:
$ export PRINTER=lp1
To have this in effect all the time, you can add this line to one of your shell configuration files
(such as $HOME/.bashrc, if you use the bash shell).
Refer to Chapter 2 for more information on using the shell.
Printing from the Shell
The lpr command is used to print files from the shell. You can use lpr to print whether the LPRng
or CUPS print service is being used. If you have a file already formatted, use lpr to print it. For
example, if you have a PostScript output file (file.ps) and you want to print it to your PostScript
printer, use the following command line:
$ lpr file.ps
If you want to specify a particular printer (other than the default), add the -Pprinter option. For
example, to print to the lp0 printer, type the following:
$ lpr -Plp0 file.ps
If you want to print more than one copy of a document, use the -#num option, where num is
replaced by the number of copies you want. For example, to print five copies of a file, use:
$ lpr -#5 file.ps
The lpr command can also accept standard output for printing.


Pages:
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093