fold(1) "ctools"
# NAME
fold - fold lines of input files
# SYNOPSIS
*fold* [-bs] [-w _width_] [_file_...]
# DESCRIPTION
*fold* will break the lines of every input _file_ into segments which will have
at most _width_ columns. By default, the column positions will be calculated in
the sense of characters' display width.
If no input file is given or "-" is listed as a filename, _stdin_ will be used
as input.
# OPTIONS
*-b*
Count _width_ in bytes.
*-s*
If a word should be broken at the end of the segment, the segment will end
after its last blank character, if such character exists.
*-w* _width_
_width_ specifies the maximum length of the segments. The default width is
80 columns.
# UNSPECIFIED BEHAVIOR
The POSIX standard does not unambiguously specify the behavior of this command
under certain conditions. Under such conditions, the ctools implementation of
*fold* behaves as follows:
- If *-w* is a not a positive integer, fold will print an error and exit with a
non-zero status code.
# DISCLAIMER
This command is part of ctools and is compatible with POSIX-1.2017, and may
optionally support XSI extensions. This man page is not intended to be a
complete reference, and where it disagrees with the specification, the
specification takes precedence.