fortypoundhead.com

FMT

Posted On 2007-05-01 by FortyPoundHead
Keywords: Command Reference
Tags: Linux Commandline Linux
Views: 1487


Reformat paragraph text, fill and join lines to produce output lines of a given width (75 characters by default).


SYNTAX
fmt [option(s)]... [file]...

OPTIONS

`-c''
`--crown-margin''
"Crown margin" mode: preserve the indentation of the first two
lines within a paragraph, and align the left margin of each
subsequent line with that of the second line.

`-t''
`--tagged-paragraph''
"Tagged paragraph" mode: like crown margin mode, except that if
indentation of the first line of a paragraph is the same as the
indentation of the second, the first line is treated as a one-line
paragraph.

`-s''
`--split-only''
Split lines only. Do not join short lines to form longer ones.
This prevents sample lines of code, and other such "formatted"
text from being unduly combined.

`-u''
`--uniform-spacing''
Uniform spacing. Reduce spacing between words to one space, and
spacing between sentences to two spaces.

`-WIDTH''
`-w WIDTH''
`--width=WIDTH''
Fill output lines up to WIDTH characters (default 75). `fmt''
initially tries to make lines about 7% shorter than this, to give
it room to balance line lengths.

`-p PREFIX''
`--prefix=PREFIX''
Only lines beginning with PREFIX (possibly preceded by whitespace)
are subject to formatting. The prefix and any preceding whitespace
are stripped for the formatting and then re-attached to each
formatted output line. One use is to format certain kinds of
program comments, while leaving the code unchanged.Notes
`fmt'' reads from the specified FILE arguments (or standard input if none are given), and writes to standard output.

The fmt utility is meant to format mail messages prior to sending, but may also be useful for other simple tasks.

By default, blank lines, spaces between words, and indentation are preserved in the output; successive input lines with different indentation are not joined; tabs are expanded on input and introduced on output.

`fmt'' prefers breaking lines at the end of a sentence, and tries to avoid line breaks after the first word of a sentence or before the last word of a sentence. A "sentence break" is defined as either the end of a paragraph or a word ending in any of `.?!'', followed by two spaces or end of line, ignoring any intervening parentheses or quotes.


About the Author

FortyPoundHead has posted a total of 1974 articles.

 


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:107.22.56.104

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

SSL Now Active
dwirch posted on June 16, 2017 at about 8:40 in Site News

SSL Now Active
dwirch posted on June 13, 2017 at about 7:59 in Site News

Coding Archive?
dwirch posted on June 3, 2017 at about 12:54 in Site News

Job Spammer: Bharti Jigyasi
dwirch posted on June 2, 2017 at about 16:57 in Spammers

Coding Archive?
dwirch posted on May 25, 2017 at about 12:38 in Site News

BWASL returns
dwirch posted on May 13, 2017 at about 15:24 in Site News