fold on the top and
fmt on the bottom.
fmt doesn’t want to break words.
fold will, given the opportunity, and actually has to be told to wrap at spaces.
fmt will also correct some spacing issues. Tacking on the
-u option pulls extra spaces and fills two spaces after a period. (My secondary school typing teacher would be proud.)
fmt also has some more sophisticated “margin” handling. You can tell
fmt to push to within X percent of the wrap limit — a “goal” — and then break a line. I’ve seen word processors with that kind of feature, usually for hyphenation.
And judging by the man page,
fmt tries to avoid breaking lines at the first word or before the last word, meaning it has some rudimentary widow and orphan control.
fmt can also set special indentations, split but not refill lines and screen lines before applying formatting.
So I guess the answer is …
fmt seems a bit more attuned to formatting text in paragraphs, and making it presentable. Like designing a help page or cleaning up wordy output.
fold on the other hand, appears more attuned to straight lines of text … perhaps annotated code or something like that.
I am a newcomer to both though, so if there’s another use for either, please let me know. 😉
P.S., does it surprise you that fmt is in coreutils too? It shouldn’t.