{
    "mode": "man",
    "parameter": "fmt",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/fmt/1/json",
    "generated": "2026-06-13T19:42:22Z",
    "synopsis": "fmt [-WIDTH] [OPTION]... [FILE]...",
    "sections": {
        "NAME": {
            "content": "fmt - simple optimal text formatter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "fmt [-WIDTH] [OPTION]... [FILE]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reformat  each paragraph in the FILE(s), writing to standard output.  The option -WIDTH is an\nabbreviated form of --width=DIGITS.\n\nWith no FILE, or when FILE is -, read standard input.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-c --crown-margin",
                    "content": "preserve indentation of first two lines\n",
                    "flag": "-c",
                    "long": "--crown-margin"
                },
                {
                    "name": "-p --prefix",
                    "content": "reformat only lines beginning with STRING, reattaching the prefix to reformatted lines\n",
                    "flag": "-p",
                    "long": "--prefix"
                },
                {
                    "name": "-s --split-only",
                    "content": "split long lines, but do not refill\n",
                    "flag": "-s",
                    "long": "--split-only"
                },
                {
                    "name": "-t --tagged-paragraph",
                    "content": "indentation of first line different from second\n",
                    "flag": "-t",
                    "long": "--tagged-paragraph"
                },
                {
                    "name": "-u --uniform-spacing",
                    "content": "one space between words, two after sentences\n",
                    "flag": "-u",
                    "long": "--uniform-spacing"
                },
                {
                    "name": "-w --width",
                    "content": "maximum line width (default of 75 columns)\n",
                    "flag": "-w",
                    "long": "--width"
                },
                {
                    "name": "-g --goal",
                    "content": "goal width (default of 93% of width)\n\n--help display this help and exit\n",
                    "flag": "-g",
                    "long": "--goal"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Ross Paterson.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/fmt>\nor available locally via: info '(coreutils) fmt invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                      FMT(1)",
            "subsections": []
        }
    },
    "summary": "fmt - simple optimal text formatter",
    "flags": [
        {
            "flag": "-c",
            "long": "--crown-margin",
            "arg": null,
            "description": "preserve indentation of first two lines"
        },
        {
            "flag": "-p",
            "long": "--prefix",
            "arg": null,
            "description": "reformat only lines beginning with STRING, reattaching the prefix to reformatted lines"
        },
        {
            "flag": "-s",
            "long": "--split-only",
            "arg": null,
            "description": "split long lines, but do not refill"
        },
        {
            "flag": "-t",
            "long": "--tagged-paragraph",
            "arg": null,
            "description": "indentation of first line different from second"
        },
        {
            "flag": "-u",
            "long": "--uniform-spacing",
            "arg": null,
            "description": "one space between words, two after sentences"
        },
        {
            "flag": "-w",
            "long": "--width",
            "arg": null,
            "description": "maximum line width (default of 75 columns)"
        },
        {
            "flag": "-g",
            "long": "--goal",
            "arg": null,
            "description": "goal width (default of 93% of width) --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).",
        "examples": [
            {
                "description": "Reformat a file",
                "command": "fmt {{path/to/file}}"
            },
            {
                "description": "Reformat a file producing output lines of (at most) `n` characters",
                "command": "fmt {{-w|--width}} {{n}} {{path/to/file}}"
            },
            {
                "description": "Reformat a file without joining lines shorter than the given width together",
                "command": "fmt {{-s|--split-only}} {{path/to/file}}"
            },
            {
                "description": "Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs)",
                "command": "fmt {{-u|--uniform-spacing}} {{path/to/file}}"
            }
        ]
    }
}