PR(1) | User Commands | PR(1) |
pr - print files
/usr/bin/pr [+ page] [-column] [-adFmrt] [-e [char] [gap]]
[-h header] [-i [char] [gap]] [-l lines]
[-n [char] [width]] [-o offset] [-s [char]]
[-w width] [-fp] [file]...
/usr/xpg4/bin/pr [+ page] [-column | -c column] [-adFmrt]
[-e [char] [gap]] [-h header] [-i [char] [gap]]
[-l lines] [-n [char] [width]] [-o offset]
[-s [char]] [-w width] [-fp] [file]...
The pr utility is a printing and pagination filter. If multiple input files are specified, each is read, formatted, and written to standard output. By default, the input is separated into 66-line pages, each with:
If standard output is associated with a terminal, diagnostic messages will be deferred until the pr utility has completed processing.
When options specifying multi-column output are specified, output text columns will be of equal width; input lines that do not fit into a text column will be truncated. By default, text columns are separated with at least one blank character.
The following options are supported. In the following option descriptions, column, lines, offset, page, and width are positive decimal integers; gap is a non-negative decimal integer. Some of the option-arguments are optional, and some of the option-arguments cannot be specified as separate arguments from the preceding option letter. In particular, the -s option does not allow the option letter to be separated from its argument, and the options -e, -i, and -n require that both arguments, if present, not be separated from the option letter.
The following options are supported for both /usr/bin/pr and /usr/xpg4/bin/pr:
+page
-column
-a
-d
-e[char][gap]
-f
-h header
-l lines
-m
-n[char][width]
-o offset
-p
-r
-s [char]
-t
-w width
For single column output, input lines will not be truncated.
The following options are supported for /usr/bin/pr only:
-F
-i[char][gap]
The following options are supported for /usr/xpg4/bin/pr only:
-F
-i[char][gap]
The following operand is supported:
file
Example 1 Printing a numbered list of all files in the current directory
example% ls -a | pr -n -h "Files in $(pwd)."
Example 2 Printing files in columns
This example prints file1 and file2 as a double-spaced, three-column listing headed by file list:
example% pr -3d -h "file list" file1 file2
Example 3 Writing files with expanded column tabs
The following example writes file1 on file2, expanding tabs to columns 10, 19, 28, ...
example% pr -e9 -t <file1 >file2
See environ(7) for descriptions of the following environment variables that affect the execution of pr: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_TIME, TZ, and NLSPATH.
The following exit values are returned:
0
>0
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
CSI | Enabled |
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
CSI | Enabled |
Interface Stability | Committed |
Standard | See standards(7). |
March 18, 1997 | OmniOS |