CUPS is default printing system for Unix and Linux systems. It provides many ways to set the default printer destination. The "LPDEST" and "PRINTER" environment variables are consulted first for the default printer.
Syntax
The syntax is as follows:
export PRINTER=printer-Name-Here
Linux / Unix: Bash Set Default Printer
Open a terminal and edit ~/.bashrc file, enter:$ vi ~/.bashrc
Set default printer to sales_hplj_1536:
OR
export PRINTER=sales_hplj_1536
Save and close the file. Relogin into your account and print a test page using lp* commands such as lp, lpr, lpq, and lprm.
PRINTER=sales_hplj_1536
export PRINTER
$ cat testfile.txt | lp
OR print ls command man page:
$ zcat /usr/share/man/man1/ls.1.gz | groff -man -Tps | lpr
Linux / Unix: CSH / TCSH Set Default Printer
Edit ~/.cshrc, enter:$ vi ~/.cshrc
Set default printer to lab_hp8500:
Save and close the file. Relogin your account and print a test page using standard Unix lp* commands.
setenv PRINTER lab_hp8500
No comments:
Post a Comment