{
    "mode": "info",
    "parameter": "fmt",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/fmt/json",
    "generated": "2026-11-11T00:07:20Z",
    "sections": {
        "File: coreutils.info,  Node: fmt invocation,  Next: pr invocation,  Up: Formatting file contents": {
            "content": "",
            "subsections": [
                {
                    "name": "4.1 'fmt': Reformat paragraph text",
                    "content": "'fmt' fills and joins lines to produce output lines of (at most) a given\nnumber of characters (75 by default).  Synopsis:\n\nfmt [OPTION]... [FILE]...\n\n'fmt' reads from the specified FILE arguments (or standard input if\nnone are given), and writes to standard output.\n\nBy default, blank lines, spaces between words, and indentation are\npreserved in the output; successive input lines with different\nindentation are not joined; tabs are expanded on input and introduced on\noutput.\n\n'fmt' prefers breaking lines at the end of a sentence, and tries to\navoid line breaks after the first word of a sentence or before the last\nword of a sentence.  A \"sentence break\" is defined as either the end of\na paragraph or a word ending in any of '.?!', followed by two spaces or\nend of line, ignoring any intervening parentheses or quotes.  Like TeX,\n'fmt' reads entire \"paragraphs\" before choosing line breaks; the\nalgorithm is a variant of that given by Donald E. Knuth and Michael F.\nPlass in \"Breaking Paragraphs Into Lines\", 'Software: Practice &\nExperience' 11, 11 (November 1981), 1119-1184.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-c'\n'--crown-margin'\n\"Crown margin\" mode: preserve the indentation of the first two\nlines within a paragraph, and align the left margin of each\nsubsequent line with that of the second line.\n\n'-t'\n'--tagged-paragraph'\n\"Tagged paragraph\" mode: like crown margin mode, except that if\nindentation of the first line of a paragraph is the same as the\nindentation of the second, the first line is treated as a one-line\nparagraph.\n\n'-s'\n'--split-only'\nSplit lines only.  Do not join short lines to form longer ones.\nThis prevents sample lines of code, and other such \"formatted\" text\nfrom being unduly combined.\n\n'-u'\n'--uniform-spacing'\nUniform spacing.  Reduce spacing between words to one space, and\nspacing between sentences to two spaces.\n\n'-WIDTH'\n'-w WIDTH'\n'--width=WIDTH'\nFill output lines up to WIDTH characters (default 75 or GOAL plus\n10, if GOAL is provided).\n\n'-g GOAL'\n'--goal=GOAL'\n'fmt' initially tries to make lines GOAL characters wide.  By\ndefault, this is 7% shorter than WIDTH.\n\n'-p PREFIX'\n'--prefix=PREFIX'\nOnly lines beginning with PREFIX (possibly preceded by whitespace)\nare subject to formatting.  The prefix and any preceding whitespace\nare stripped for the formatting and then re-attached to each\nformatted output line.  One use is to format certain kinds of\nprogram comments, while leaving the code unchanged.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}