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:
- -b
- 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.
- -s
- 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.
- -w width
- Set the maximum output line length (in columns or bytes) to width
instead of the default 80.
- LANG,
LC_ALL
- See locale(7).
- LC_CTYPE
- 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.