fold
ShellFundamentals In simulator In real LinuxWrap lines to a given width
Name: fold
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
fold wraps lines longer than a given width (80 by default). -s breaks at spaces where possible so words aren't cut in half.
Syntax
fold [OPTION]... [FILE]...Common options
| -w / --width WIDTH | Line width (default 80) |
| -s / --spaces | Break at spaces |
| -b / --bytes | Count bytes rather than columns |
Examples
$ fold -w 40 -s article.txt
At most 40 characters per line
Explain