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. Specifywidth
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.
Get Mac OS X Tiger in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.