DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

fold(1)


fold -- fold long lines

Synopsis

fold [-bs] [-w width | -width] [file . . . ]

Description

Fold the contents of the specified files, or the standard input if no files are specified, breaking the lines to have maximum width of width screen columns (or bytes if -b is specified). A line shall not be broken in the middle of a character (as specified by the locale given in LC_CTYPE, see LANG on environ(5)).

If a backspace character occurs in the input, the width count will be decremented by one (but will never go below zero). If a tab character occurs, the width count is set to the next tab stop. The next tab stop is the next value of width that is a multiple of eight (counting the first column as column 0).

Options


-b
Count width in bytes. If this option is not specified, width is counted in column positions.

-s
If a segment of a line contains a blank within the first width column positions (or bytes), break the line after the last such blank meeting the width constraints. If there is no such blank, -s will have no effect for that output segment of the input line. (A blank is defined by the current locale's LC_CTYPE, see LANG on environ(5))

-w width
Specify the maximum width in screen columns (or bytes, if -b is specified). The default for width is 80. width should be a multiple of 8 if tabs are present, or the tabs should be expanded.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxdfm
language-specific message file (See LANG on environ(5).)

References

fmt(1), pr(1)

Notices

Folding may not work correctly if underlining or overstriking is present.

The -width option is provided for backward compatibility, it will be removed in a future release. The -w width option should be used.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004