Monday, June 11, 2007

Wrap or Fold Long Lines in a File for Printing

Occasionally, you may have to deal with files that exceed common printing parameters, e.g. columns 80 or 132. The fold command is a filter designed to deal with this type of issue. Personally, I have used it on a few log files. Here is an example of its use.

# fold –w 132 longlinefile | lp

Or output to a file
# fold –w 132 longlinefile > new_file

1 comment:

Anonymous said...

Thanks to your page I found the right command in 1 minute.