fold (break lines at a specified column)

Breaks the lines in a file so that they don't continue past a certain column. The default width is 80.

Format:    fold filelist
Examples:  fold file1 file3

Breaks any lines longer than 80 columns at 80, moving the remaining columns to a new line.

OptWhat It DoesExample
-bUse bytes to decide where to break linesfold -b report3
-sBreak at spaces, not in middle of wordfold -s reportX
-w nSet width to n, rather than 80fold -w 70 reportY

Get Spring Into Linux® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.