oreilly.comSafari Books Online.Conferences.


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.


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.



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.


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


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 will all set the maximum width to six columns.

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: