fold—folds long lines

fold [-bs] [-w width] [--bytes] [--spaces][--width=width][--help]
   [--version] [file…]

Folds the contents of the specified filenames, or the standard input if no files are specified, breaking the lines to have maximum width. The default for width is 80. Width should be a multiple of eight if tabs are present, or the tabs should be expanded.

Example A.30.
% fold --help
					Usage: fold [OPTION]… [FILE]…
					Wrap input lines in each FILE (standard input by default),
					writing to
					standard output.
					-b, --bytes         count bytes rather than columns
					-s, --spaces        break at spaces
					-w, --width=WIDTH   use WIDTH columns instead of 80
					Report bugs to textutils-bugs@gnu.ai.mit.edu
				

Get Linux Shells by Example 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.