Unix printing examples
Here are some examples of printing files with various combinations of the lpr, enscript, 2up, dvips, and psduplex commands. Not all utilities
are available on all Unix systems;
however, enscript, psduplex, and the PSUtils are installed on Steel at Indiana University.
In all examples, replace printername with the defined name of
the printer. Also, in examples using the lpr commands, you could
use the equivalent lp
commands.
- Print a text file, one page per sheet, one-sided: lpr -Pprintername -h filename.txt
- Print a text file, two pages per sheet, one-sided, gaudy headers, landscape mode: enscript -Pprintername -2rGh filename.txt or: enscript -hl -p- filename.txt | 2up | lpr -Pprintername -h
- Print a text file as in step 2, but on both sides of the paper: enscript -lh filename.txt | psduplex | lpr -Pprintername -h or: enscript -hl -p- filename.txt | 2up | psduplex | lpr -Pprintername -h
- Print a text file as in step 2, but on both sides of the paper, with you owning the job but getting a header page: enscript -2rG -p- filename.txt | psduplex | lpr -Pprintername
- Print as in 2, but with you not owning the job (i.e., can't remove it from the queue), without getting a header page: enscript -2rGh -Pprintername filename.txt
- Print a text file on both sides of the paper, with four or eight pages per side of one sheet, saving paper: enscript -hl -p- filename.txt | 4up | psduplex | lpr -Pprintername -h enscript -hl -p- filename.txt | 8up | psduplex | lpr -Pprintername -h
- Print a PostScript (PS) file, one page per sheet, one-sided: lpr -Pprintername -h filename.ps
- Print a PS file, two pages per sheet, landscape, one-sided: 2up filename.ps | lpr -Pprintername -h
- Print a compressed PS file as in step 7: zcat filename.ps.Z | lpr -Pprintername -h
- Print a compressed PS file as in step 8: zcat filename.ps.Z | 2up | lpr -Pprintername -h
- Print a PS file as in step 7, but double-sided: cat filename.ps | psduplex | lpr -Pprintername -h
- Print a PS file as in step 8, but double-sided: 2up filename.ps | psduplex | lpr -Pprintername -h
- Produce a PS file from a DVI file: dvips -o outfilename.ps filename.dvi
- Print a DVI file one-sided, one page per sheet: dvips -f < filename.dvi | lpr -Pprintername -h
- As in step 14, but double-sided: dvips -f < filename.dvi | psduplex | lpr -Pprintername -h
- As in step 14, but two pages per sheet: dvips -f <
filename.dvi | 2up | lpr -Pprintername -h You can also use
4upor8upif you want. - As in step 15, but two pages per sheet: dvips -f < filename.dvi | 2up | psduplex | lpr -Pprintername -h
Also see:
- In LaTeX or TeX in Unix, how do I create and print a document?
- In Unix, how do I get a printed copy of a manual page?
- In Unix, how do I print files and list or remove print jobs?
- Introduction to Unix commands
- What is enscript, and how can I use it to print text files in PostScript?
- What is psduplex, and how can I use it to print on both sides of pages?
- In Unix, how do I print side-by-side pages in landscape mode?
- What is dvips, and how do I use it to print DVI files?
- At IU, how do I find out what printers are available from the UITS central systems?
This is document abbp in domain
all.
Last modified on June 01, 2005.
Last modified on June 01, 2005.
Please tell us, did you find the answer to your
question?



