fold â wrap each input line to fit in specified width
| Use Case | Command | Description |
|---|---|---|
| Wrap lines at default 80 columns | fold file | đ Wraps each line of file to 80 columns wide |
| Wrap by byte count instead of columns | fold -b file | đĸ Counts bytes (e.g., for multibyte characters) |
| Break at spaces only | fold -s file | đĒ Avoids splitting words in the middle |
| Set custom width | fold -w 40 file | đ Wrap at 40 columns instead of 80 |
| Read from stdin | echo "text" | fold -w 10 | đĨ Pipe input directly |
fold [OPTION]... [FILE]...
Wrap input lines in each FILE, writing to standard output.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-b, --bytes â đĸ count bytes rather than columns-s, --spaces â đĒ break at spaces-w, --width=WIDTH â đ use WIDTH columns instead of 80--help â âšī¸ display this help and exit--version â đ¤ output version information and exitWritten by David MacKenzie.
GNU coreutils online help: https://www.gnu.org/software/coreutils/
Report any translation bugs to https://translationproject.org/team/
Copyright Š 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Full documentation https://www.gnu.org/software/coreutils/fold
or available locally via: info '(coreutils) fold invocation'
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 09:13 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)