LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pr

Paginate and format text for printing

TLDR

Format file for printing
$ pr [file]
copy
Add page header
$ pr -h "[Header Text]" [file]
copy
Multi-column output
$ pr -[3] [file]
copy
Double space output
$ pr -d [file]
copy
Number lines
$ pr -n [file]
copy

SYNOPSIS

pr [options] [files]

DESCRIPTION

pr formats text files for printing by adding page headers (with filename and date), footers, page breaks, and line numbers. It can arrange text into multiple columns and control page dimensions including length, width, and margins.This traditional Unix utility is useful for preparing plain text documents for printing or for creating formatted multi-column layouts from single-column input. It reads from files or stdin and writes to stdout.

PARAMETERS

FILES

Input files.
-h HEADER
Page header text.
-NUM
Number of columns.
-d
Double space.
-n
Number lines.
-l LINES
Page length.
-w WIDTH
Page width.
-m
Merge files side by side.
-t
Omit headers and footers.
-s CHAR
Separate columns with character.

INSTALL

sudo apt install coreutils
copy
sudo dnf install coreutils
copy
sudo pacman -S coreutils
copy
sudo apk add coreutils
copy
sudo zypper install coreutils
copy
brew install coreutils
copy
nix profile install nixpkgs#coreutils
copy

CAVEATS

Default page length is 66 lines (for 11-inch paper). Headers include filename and date by default. Input must be text; binary files produce unpredictable output.

HISTORY

pr has been part of Unix since the early 1970s at Bell Labs, originally used to prepare text files for line printers. It is specified in POSIX and included in GNU coreutils.

SEE ALSO

fmt(1), fold(1), column(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid