There are times when you might need to print out documents that can span numerous pages. Often times, it's helpful to have the pages paginated with a detailed header (date, time, filename, and page number). The pr command can do these things. Here are some examples of its use.
Prints 5 Line Header and Trailer. It also provides date, time, filename, and page number.
# pr esofthub.txt | lp
Jan 9 08:52 2006 esofthub.txt Page 1
Suppresses 5 Line Header and Trailer. It also suppresses date, time, filename, and page number.
#pr -t esofthub.txt | lp
Double spaced and prints 5 Line Header and Trailer. It also provides date, time, filename, and page number.
# pr -d esofthub.txt | lp
Double spaced, numbered lines, and prints 5 Line Header and Trailer. It also provides date, time, filename, and page number.
# pr -dn esofthub.txt | lp
Lists a directory and prints its contents in 6 columns without a header
# ls | pr -t6 | lp
Lists a directory and starts printing on page 4 with a header
#ls | pr +4 | lp
Lists a directory and prints a modified header (filename is replaced with esofthub pagetest)
#ls | pr -h 'esofthub pagetest' | lp
This blog covers Unix system administration HOWTO tips for using inline for loops, find command, Unix scripting, configuration, SQL, various Unix-based tools, and command line interface syntax. The Unix OS supports tasks such as running hardware, device drivers, peripherals and third party applications. Share tips/comments. Read the comments. But most importantly: Read Disclaimer - Read Disclaimer.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment