Break long lines at a fixed width.

Section: Formatting and Cleanup

Force hard wraps

bash
bash
fold -w 80 long-lines.txt
Explanation

Unlike `fmt`, `fold` wraps mechanically rather than reflowing paragraphs.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Formatting and Cleanup
Wrap text to 72 columns
Reflow long text paragraphs.
OpenIn sheetbashsame section
Squeeze repeated spaces
Collapse multiple spaces into one.
OpenIn sheetbashsame section
Trim leading whitespace
Remove spaces and tabs from the start of each line.
OpenIn sheetbashsame section
Trim trailing whitespace
Remove spaces and tabs from line endings.
OpenIn sheetbashsame section
Print a specific line range
Extract lines 100 through 120.
OpenIn sheetbash1 tag match
Pipe file content into grep
Basic pipeline for filtering text from a file.