Thursday, January 15, 2009

fold command

when you are writing documentation with, for example , vi, the lines tend to get really long. the length of a line while working is usually no problem, but as soon as the document is finished, those long lines sometimes get in the way and are hard to grasp.

fortunately, more people used to have to deal with that problem , and the result is the command fold.fold does one thing; it folds longer lines to a more manageable 80 characters(default), or any other length using the -w parameter. to make sure fold does not break a word , the option -s is used to break a line only at the nearest whitespace character.


ex:- fold -s file_with_long_lines.txt


source :- Erik M Keller

No comments:

Post a Comment