Bash One-Liners
One-Liners
Format text with long lines to text with fixed width
fmt -s -w80 file.txt
January 22, 2012
—
bashoneliners
Explanation
It will break lines longer than 80 characters at appropriate white spaces to make them less than 80 characters long.
The
-s
flag will collapse multiple consecutive white spaces into one, or at the end of a sentence a double space.
text-formatting
fmt
Tweet