FOLD(1) User Commands FOLD(1)

fold - fold long lines

fold [-b] [-s] [-w width | -width] [file ...]

Fold reads its input files, or of standard input if no file argument is present, and folds lines that exceed 80 columns (i.e. it inserts newline characters). It interprets backspace, tabulator, and carriage return characters in input.

The following options are accepted by fold:

Use bytes instead of columns. All characters except for the newline character are counted according to the space consumed in bytes. This option has been introduced by POSIX.2.
Try to preserve words, if possible. If a blank character appears in an input line before it exceeds the width limit, the line is prematurely folded after this character. This option has been introduced by POSIX.2.
Set the maximum output line length (in columns or bytes) to width instead of the default 80.

See locale(7).
Determines the mapping of bytes to characters and the set of blank characters. Multibyte characters are not split by fold; the line is folded before the character that would cause it to exceed the maximum width.

fmt(1), pr(1)

12/6/04 Heirloom Toolchest