pr - Writes a file to standard output
pr [-adfFmprt] [-e][character][number] [-h header] [-i][character][gap] [-l lines] [-n][character][width]|[-x][character][number] [-o offset] [-s][character] [-w width] [-column] [+page] [file...]
to standard output. If you do not specify
reads standard input.
Interfaces documented on this reference page conform to industry standards as follows:
pr: XPG4, XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
Displays multicolumn output across the page. (This option is meaningful only in combination with the -column option. It modifies -column so that columns are filled across the page in a round robin order.) Doublespaces the output. Expands tabs to byte positions number+1, 2*number+1, 3*number+1, and so on. The default value of number is 8. Tab characters in the input expand to the appropriate number of spaces to line up with the next tab setting. If you specify character (any character other than a digit) that character becomes the input tab character. The default value of character is the ASCII tab character. Uses a formfeed character to advance to a new page. (Otherwise, pr issues a sequence of newline characters.) Pauses before beginning the first page if the standard output is a terminal. Uses a formfeed character to advance to a new page. (Otherwise, pr issues a sequence of newline characters.) Does not pause before beginning the first page if the standard output is a terminal. Displays header instead of the file name in the page header. Replaces multiple space characters with tab characters wherever two or more space characters reach positions gap+1, 2*gap+1, 3*gap+1, and so on. The default value of gap is 8. If you specify character (any character other than a digit), that character becomes the output tab character. (The default value of character is the ASCII tab character.) Sets the length of a page to lines lines (the default is 66). If lines is not greater than the sum of the header and trailer, pr suppresses both header and trailer, as if -t were in effect. Combines and writes all files at the same time, with each file in a separate column. (This overrides the -column and -a options). Provides width-digit line numbering (the default value of width is 5). The number occupies the first width positions of each column of normal output (or each line of -m output). If you specify character (any character, other than a digit), that character is added to the line number to separate it from whatever follows. (The default value of character is an ASCII tab character.) Indents each line of output by offset byte positions (the default is 0). This is in addition to output width (see -w). Pauses before beginning each page if the output is directed to a terminal. (pr sounds the bell at the terminal and waits for you to press <Return>.) Does not display diagnostic messages if the system cannot open files. Separates columns by the single character instead of by the appropriate number of spaces (the default for character is an ASCII tab character). Does not display the 5-line identifying header and the 5-line footer. Stops after the last line of each file without spacing to the end of the page. [Compaq] Same as -n. Sets the width of a line to width byte positions. If neither -w or -s are specified, the default is 72. If only -s is specified, the default is 512. Single column output is not truncated. Produces the specified number of columns (the default value is 1). The -e and -i options are assumed for multicolumn output. A text column never exceeds the width of the page (see -l). Begins the display at the specified page number (the default value is 1).
The path name of a file to written. If no
is specified, or
(hyphen) is specified,
standard input is used.
A heading that contains the page number, date, time, and the name of the file separates the output into pages.
Unless specified, columns are of equal width and separated by at least one space. Lines that are too long for the page width are shortened. If the standard output is a terminal, pr does not display any error messages until it has ended. By default, the input is separated into 66-line pages, including the 5-line header and 5-line footer.
If standard output is a terminal, diagnostic (error) messages produced
during the operation of
will be deferred and printed
has completed processing.
The following exit values are returned:
All files have been successfully written.
An error occurred.
To print a file with headings and page numbers on the printer, enter: pr prog.c | lpr
The following environment variables affect the execution of
Provides a default value for the internationalization variables
that are unset or null. If
is unset or null, the corresponding value from the default locale is used.
If any of the internationalization variables contain an invalid setting, the
utility behaves as if none of the variables had been defined.
If set to a non-empty string value, overrides the values of
all the other internationalization variables.
Determines the locale for the interpretation of sequences
of bytes of text data as characters (for example, single-byte as opposed to
multibyte characters in arguments).
Determines the locale for the format and contents of diagnostic
messages written to standard error.
Determines the format of the date and time used in writing
Determines the location of message catalogues for the processing
Your terminal, used when the
Commands: cat(1), expand(1), mesg(1)