Line wrap text from a Ubuntu Linux terminal

Updated . Posted . Visible to the public.

You can use fold:

fold -sw 60

You can now paste your texts. fold will echo them back, word-wrapped after 60 columns. Exit with Ctrl+C or Ctrl+D.

You can also use files for input and output:

fold -sw 60 input.txt > output.txt
Henning Koch
Last edit
Keywords
shell, console
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2011-09-13 13:22)