fold
text processingLinux/Unix
The fold command is one of the most frequently used commands in Linux/Unix-like operating systems. fold Wrap input lines to fit specified width
Quick Reference
Command Name:
fold
Category:
text processing
Platform:
Linux/Unix
Basic Usage:
fold [options] [arguments]
Common Use Cases
Syntax
fold [options] [file...]
Options
| Option | Description |
|---|---|
-b, --bytes |
Count bytes rather than columns (important for multi-byte characters) |
-s, --spaces |
Break at spaces (avoid breaking words) |
-w, --width=WIDTH |
Set output line width to WIDTH columns (default is 80) |
--help |
Display help information and exit |
--version |
Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the fold command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.