O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

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

fmt

Synopsis

fmt [goal [maximum]] [files]

Converts text to specified width by filling lines and removing newlines. Width is specified as being close to goal characters, but not over maximum characters wide (65 and 75 characters by default). Concatenate files on the command line, or read text from standard input if no file is specified. By default, preserve blank lines, spacing, and indentation. fmt attempts to break lines at the end of sentences and to avoid breaking lines after a sentence's first word or before its last.

Options

-c

Center each line.

-d chars

Define chars as the characters that end a sentence. By default, these are period, exclamation point, and question mark.

-l width

Replaces each width spaces at the beginning of a line with a tab character. Default is 8. Specify width of 0 to turn off this tab unexpansion.

-m

Try to format mail headers correctly.

-n

Format each line, even if it starts with a dot.

-p

Handle indented paragraphs. Without this flag, changes in the amount of whitespace at the beginning of a line indicates a new paragraph.

-s

Compress multiple whitespace characters into a single space.

-t width

Assume width spaces per tab in the input files.

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