MYSYSAD.COM

Wrap or Fold Long Lines in a File for Printing

· Shell & text · Files & disks

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