GNU Info

Info Node: ( invocation

( invocation

Next: fold invocation Prev: fmt invocation Up: Formatting file contents
Enter node , (file) or (file)node

`pr': Paginate or columnate files for printing

   `pr' writes each FILE (`-' means standard input), or standard input
if none are given, to standard output, paginating and optionally
outputting in multicolumn format; optionally merges all FILEs, printing
all in parallel, one per column.  Synopsis:

     pr [OPTION]... [FILE]...

   By default, a 5-line header is printed at each page: two blank lines;
a line with the date, the filename, and the page count; and two more
blank lines.  A footer of five blank lines is also printed.  With the
`-F' option, a 3-line header is printed: the leading two blank lines are
omitted; no footer is used.  The default PAGE_LENGTH in both cases is 66
lines.  The default number of text lines changes from 56 (without `-F')
to 63 (with `-F').  The text line of the header takes up the full
PAGE_WIDTH in the form `yyyy-mm-dd HH:MM string Page nnnn'.  String is
a centered header string.

   Form feeds in the input cause page breaks in the output.  Multiple
form feeds produce empty pages.

   Columns are of equal width, separated by an optional string (default
is `space').  For multicolumn output, lines will always be truncated to
PAGE_WIDTH (default 72), unless you use the `-J' option.  For single
column output no line truncation occurs by default.  Use `-W' option to
truncate lines in that case.

   Including version 1.22i:

   Some small LETTER OPTIONS (`-s', `-w') has been redefined with the
object of a better POSIX compliance.  The output of some further cases
has been adapted to other UNIXes.  A violation of downward
compatibility has to be accepted.

   Some NEW CAPITAL LETTER options (`-J', `-S', `-W') has been
introduced to turn off unexpected interferences of small letter
options.  The `-N' option and the second argument LAST_PAGE of
`+FIRST_PAGE' offer more flexibility.  The detailed handling of form
feeds set in the input files requires `-T' option.

   Capital letter options dominate small letter ones.

   Some of the option-arguments (compare `-s', `-S', `-e', `-i', `-n')
cannot be specified as separate arguments from the preceding option
letter (already stated in the POSIX specification).

   The program accepts the following options.  Also see Note: Common

     Begin printing with page FIRST_PAGE and stop with LAST_PAGE.
     Missing `:LAST_PAGE' implies end of file.  While estimating the
     number of skipped pages each form feed in the input file results
     in a new page.  Page counting with and without `+FIRST_PAGE' is
     identical.  By default, counting starts with the first page of
     input file (not first page printed).  Line numbering may be
     altered by `-N' option.

     With each single FILE, produce COLUMN columns of output (default
     is 1) and print columns down, unless `-a' is used.  The column
     width is automatically decreased as COLUMN increases; unless you
     use the `-W/-w' option to increase PAGE_WIDTH as well.  This
     option might well cause some lines to be truncated.  The number of
     lines in the columns on each page are balanced.  The options `-e'
     and `-i' are on for multiple text-column output.  Together with
     `-J' option column alignment and line truncation is turned off.
     Lines of full length are joined in a free field format and `-S'
     option may set field separators.  `-COLUMN' may not be used with
     `-m' option.

     With each single FILE, print columns across rather than down.  The
     `-COLUMN' option must be given with COLUMN greater than one.  If a
     line is too long to fit in a column, it is truncated.

     Print control characters using hat notation (e.g., `^G'); print
     other unprintable characters in octal backslash notation.  By
     default, unprintable characters are not changed.

     Double space the output.

     Expand TABs to spaces on input.  Optional argument IN-TABCHAR is
     the input tab character (default is the TAB character).  Second
     optional argument IN-TABWIDTH is the input tab character's width
     (default is 8).

     Use a form feed instead of newlines to separate output pages.  The
     default page length of 66 lines is not altered.  But the number of
     lines of text per page changes from default 56 to 63 lines.

     Replace the filename in the header with the centered string HEADER.
     Left-hand-side truncation (marked by a `*') may occur if the total
     header line `yyyy-mm-dd HH:MM HEADER Page nnnn' becomes larger than
     PAGE_WIDTH.  `-h ""' prints a blank line header.  Don't use `-h""'.
     A space between the `-h' option and the argument is always

     Replace spaces with TABs on output.  Optional argument OUT-TABCHAR
     is the output tab character (default is the TAB character).
     Second optional argument OUT-TABWIDTH is the output tab
     character's width (default is 8).

     Merge lines of full length.  Used together with the column options
     `-COLUMN', `-a -COLUMN' or `-m'.  Turns off `-W/-w' line
     truncation; no column alignment used; may be used with
     `-S[STRING]'.  `-J' has been introduced (together with `-W' and
     `-S') to disentangle the old (POSIX compliant) options `-w' and
     `-s' along with the three column options.

     Set the page length to PAGE_LENGTH (default 66) lines, including
     the lines of the header [and the footer].  If PAGE_LENGTH is less
     than or equal 10 (and <= 3 with `-F'), the header and footer are
     omitted, and all form feeds set in input files are eliminated, as
     if the `-T' option had been given.

     Merge and print all FILEs in parallel, one in each column.  If a
     line is too long to fit in a column, it is truncated, unless `-J'
     option is used.  `-S[STRING]' may be used.  Empty pages in some
     FILEs (form feeds set) produce empty columns, still marked by
     STRING.  The result is a continuous line numbering and column
     marking throughout the whole merged file.  Completely empty merged
     pages show no separators or line numbers.  The default header
     becomes `yyyy-mm-dd HH:MM <blanks> Page nnnn'; may be used with
     `-h HEADER' to fill up the middle blank part.

     Provide DIGITS digit line numbering (default for DIGITS is 5).
     With multicolumn output the number occupies the first DIGITS
     column positions of each text column or only each line of `-m'
     output.  With single column output the number precedes each line
     just as `-m' does.  Default counting of the line numbers starts
     with 1st line of the input file (not the 1st line printed, compare
     the `--page' option and `-N' option).  Optional argument
     NUMBER-SEPARATOR is the character appended to the line number to
     separate it from the text followed.  The default separator is the
     TAB character.  In a strict sense a TAB is always printed with
     single column output only.  The TAB-width varies with the
     TAB-position, e.g. with the left MARGIN specified by `-o' option.
     With multicolumn output priority is given to `equal width of
     output columns' (a POSIX specification).  The TAB-width is fixed
     to the value of the 1st column and does not change with different
     values of left MARGIN.  That means a fixed number of spaces is
     always printed in the place of the NUMBER-SEPARATOR TAB.  The
     tabification depends upon the output position.

     Start line counting with the number LINE_NUMBER at first line of
     first page printed (in most cases not the first line of the input

     Indent each line with a margin MARGIN spaces wide (default is
     zero).  The total page width is the size of the margin plus the
     PAGE_WIDTH set with the `-W/-w' option.  A limited overflow may
     occur with numbered single column output (compare `-n' option).

     Do not print a warning message when an argument FILE cannot be
     opened.  (The exit status will still be nonzero, however.)

     Separate columns by a single character CHAR.  Default for CHAR is
     the TAB character without `-w' and `no character' with `-w'.
     Without `-s' default separator `space' is set.  `-s[char]' turns
     off line truncation of all three column options (`-COLUMN'|`-a
     -COLUMN'|`-m') except `-w' is set.  That is a POSIX compliant

     Use STRING to separate output columns.  The `-S' option doesn't
     affect the `-W/-w' option, unlike the `-s' option which does.  It
     does not affect line truncation or column alignment.  Without
     `-S', and with `-J', `pr' uses the default output separator, TAB.
     Without `-S' or `-J', `pr' uses a `space' (same as `-S" "').
     Using `-S' with no STRING is equivalent to `-S""'.  Note that for
     some of `pr''s options the single-letter option character must be
     followed immediately by any corresponding argument; there may not
     be any intervening white space.  `-S/-s' is one of them.  Don't
     use `-S "STRING"'.  POSIX requires this.

     Do not print the usual header [and footer] on each page, and do
     not fill out the bottom of pages (with blank lines or a form
     feed).  No page structure is produced, but form feeds set in the
     input files are retained.  The predefined pagination is not
     changed.  `-t' or `-T' may be useful together with other options;
     e.g.: `-t -e4', expand TAB characters in the input file to 4
     spaces but don't make any other changes.  Use of `-t' overrides

     Do not print header [and footer].  In addition eliminate all form
     feeds set in the input files.

     Print unprintable characters in octal backslash notation.

     Set page width to PAGE_WIDTH characters for multiple text-column
     output only (default for PAGE_WIDTH is 72).  `-s[CHAR]' turns off
     the default page width and any line truncation and column
     alignment.  Lines of full length are merged, regardless of the
     column options set.  No PAGE_WIDTH setting is possible with single
     column output.  A POSIX compliant formulation.

     Set the page width to PAGE_WIDTH characters.  That's valid with and
     without a column option.  Text lines are truncated, unless `-J' is
     used.  Together with one of the three column options (`-COLUMN',
     `-a -COLUMN' or `-m') column alignment is always used.  The
     separator options `-S' or `-s' don't affect the `-W' option.
     Default is 72 characters.  Without `-W PAGE_WIDTH' and without any
     of the column options NO line truncation is used (defined to keep
     downward compatibility and to meet most frequent tasks).  That's
     equivalent to `-W 72 -J'.  With and without `-W PAGE_WIDTH' the
     header line is always truncated to avoid line overflow.

automatically generated by info2www version