O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

fold

Synopsis

fold [option] [files]

Break the lines of the named files so that they are no wider than the specified width. fold breaks lines exactly at the specified width, even in the middle of a word. Reads from standard input when given - as a file. By default, fold cuts at 80 columns; tab counts as multiple columns, and a backspace as negative one.

Options

-b, --bytes

Count bytes instead of columns, making tab, backspace, and return characters count as one byte instead of altering the column count, as in the default behavior.

-c, --characters

Count characters, not columns. Similar to counting by bytes.

-s, --spaces

Break at spaces only, if possible.

-w, --width width, -width

Set the maximum line width to width. The flags -w 6, --width 6, and −6 all set the maximum width to six columns.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required