Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 282010
 

Wrap each line to fit in specified width

Answer:

If you want to format a text file into a specific width, you can use the fold command

E.g.

# fold -w 40 test.txt

The above command will wrap the text file and print to standard out, with width = 40 characters.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>