pr(1)
NAME
pr − print files
SYNTAX
pr [ options ] [ files ]
DESCRIPTION
The pr command prints the named files on the standard output. If file is designated by an en dash (-), or if no files are specified the pr command assumes standard input. By default, the listing is separated into pages, each headed by the page number, a date and time, and the name of the file.
By default, columns are of equal width, separated by at least one space. Lines that do not fit are truncated. However, if the −s option is used, lines are not truncated and columns are separated by the separation character.
If the standard output is associated with a terminal, error messages are withheld until pr has finished printing.
This command exists for X/OPEN compatibility.
OPTIONS
The following options can be used singly or in combination:
−aPrints multi-column output across the page.
−bPrints blank headers.
−dDouble-spaces the output.
−e ckExpands input tabs to character positions k+1, 2*k+1, 3*k+1,... n*k+1. If k is 0 or is omitted, tabs are set at every eighth position. Tab characters in the input are expanded into the appropriate number of spaces. The default for c (any non-digit character) is the tab character; therefore, if c is given, it is treated as the input tab character.
−fUses form-feed character for new pages. The default is to use a sequence of line-feeds. The -f option causes the pr command to pause before beginning the first page if the standard output is associated with a terminal.
−hUses the next argument as the header to be printed instead of the file name.
−i ckReplaces white space in output by inserting tabs to character positions k+1, 2*k+1, 3*k+1,...n*k+1. If k is 0 or is omitted, tabs are set at every eighth position. The default for c (any non-digit character) is the tab character; therefore, if c is given, it is treated as the input tab character.
+kBegins printing with page k (default is 1).
−kProduces k-column output (default is 1). The −e and −i options are assumed for multi-column output.
−l kSets the length of a page to k lines. The default is 66 lines.
−mMerges and prints all files simultaneously, one per column (overrides the −k, and −a options).
−n ckNumbers lines. The default for k is 20. The number occupies the first k+1 character positions of each column of normal output or each line of −m output. If c, which is any non-digit character is given, it is appended to the line number to separate it from whatever follows. The default for c is a tab.
−o kOffsets each line by k character positions (default is 0). The number of character positions per line is the sum of the width and offset.
−pPauses before beginning each page if the output is directed to a terminal. The pr command rings the bell at the terminal and awaits a carriage return.
−rSuppresses diagnostic reports on failure to open files.
−s cSeparates columns by the single character c instead of by the appropriate number of spaces (default for c is a tab).
−tSupresses the five-line identifying header and the five-line trailer normally supplied for each page. The -t option causes the pr command to quit printing after the last line of each file without spacing to the end of the page.
−w kSets the width of a line to k character positions. The default is 72 for equal-width multi-column output; otherwise there is no limit.
EXAMPLES
Print file1 and file2 as a double-spaced, three-column listing with the heading: file list.
pr −3dh "file list" file1 file2
Write file1 on file2, expanding tabs to columns 10, 19, 28, 37,...:
pr −e9 −t <file1>file2
FILES
/dev/tty∗to suspend messages