Similar in intent, but fmt is the more powerful of the two.
The purpose is to reformat lines to fit a fixed width output
device, and to do it intelligently so that lines are broken at
appropriate places rather than mid wo
rd (like that).
Within vi, you can simply do ":.!fmt" to fix an unruly paragraph, or ":1,$!fmt" to do the entire document. That's simple usage, "fmt" has many useful options.
Of course, "fmt file | lpr" can also be useful.
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic