Linux "pr" Command Line Options and Examples
convert text files for printing

Paginate or columnate FILE(s) for printing. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too.


Usage:

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




Command Line Options:

-COLUMN
output COLUMN columns and print columns down, unless -a is used. Balance number of lines in the columnson each page
pr -COLUMN ...
-a
print columns across rather than down, used together with -COLUMN
pr -a ...
-c
use hat notation (^G) and octal backslash notation
pr -c ...
-d
double space the output
pr -d ...
-D
use FORMAT for the header date
pr -D ...
-e[CHAR[WIDTH]]
expand input CHARs (TABs) to tab WIDTH (8)
pr -e[CHAR[WIDTH]] ...
-F
use form feeds instead of newlines to separate pages (by a 3-line page header with -F or a 5-lineheader and trailer without -F)
pr -F ...
-h
use a centered HEADER instead of filename in page header, -h "" prints a blank line, don't use -h""
pr -h ...
-i[CHAR[WIDTH]]
replace spaces with CHARs (TABs) to tab WIDTH (8)
pr -i[CHAR[WIDTH]] ...
-J
merge full lines, turns off -W line truncation, no column alignment, --sep-string[=STRING] sets separa‐tors
pr -J ...
-l
set the page length to PAGE_LENGTH (66) lines (default number of lines of text 56, and with -F 63).implies -t if PAGE_LENGTH <= 10
pr -l ...
-m
print all files in parallel, one in each column, truncate lines, but join lines of full length with -J
pr -m ...
-n[SEP[DIGITS]]
number lines, use DIGITS (5) digits, then SEP (TAB), default counting starts with 1st line of inputfile
pr -n[SEP[DIGITS]] ...
-N
start counting with NUMBER at 1st line of first page printed (see +FIRST_PAGE)
pr -N ...
-o
offset each line with MARGIN (zero) spaces, do not affect -w or -W, MARGIN will be added to PAGE_WIDTH
pr -o ...
-r
omit warning when a file cannot be opened
pr -r ...
-s[CHAR]
separate columns by a single character, default for CHAR is the <TAB> character without -w and 'nochar' with -w. -s[CHAR] turns off line truncation of all 3 column options (-COLUMN|-a -COLUMN|-m)except -w is set
pr -s[CHAR] ...
-S[STRING]
separate columns by STRING, without -S: Default separator <TAB> with -J and <space> otherwise (same as
pr -S[STRING] ...
-S"
no effect on column options
pr -S" ...
-t
omit page headers and trailers; implied if PAGE_LENGTH <= 10
pr -t ...
-T
omit page headers and trailers, eliminate any pagination by form feeds set in input files
pr -T ...
-v
use octal backslash notation
pr -v ...
-w
set page width to PAGE_WIDTH (72) characters for multiple text-column output only, -s[char] turns off(72)
pr -w ...
-W
set page width to PAGE_WIDTH (72) characters always, truncate lines, except -J option is set, no inter‐ference with -S or -s
pr -W ...
--help
display this help and exit
pr --help ...
--version
output version information and exitAUTHORWritten by Pete TerMaat and Roland Huebner.REPORTING BUGSGNU coreutils online help: <http://www.gnu.org/software/coreutils/>Report pr translation bugs to <http://translationproject.org/team/>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent per‐mitted by law.
pr --version ...