FMT(1) User Commands FMT(1)
fmt - simple optimal text formatter
| Use Case | Command | Description |
|---|---|---|
| Format a file | fmt file.txt | Reformat all paragraphs in the file |
| Set line width to 80 | fmt -w 80 file.txt | Maximum line width of 80 columns |
| Preserve first two lines indentation | fmt -c file.txt | Crown‑margin mode (keeps first two lines indented) |
| Reformat only lines with a prefix | fmt -p ">" file.txt | Only process lines starting with > |
| Split long lines without refilling | fmt -s file.txt | Split only, no refilling of short lines |
fmt [-WIDTH] [OPTION]... [FILE]...
Reformat each paragraph in the FILE(s), writing to standard output. The option -WIDTH is an abbreviated form of --width=DIGITS.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-c, --crown-marginPreserve indentation of first two lines
-p, --prefix=STRINGReformat only lines beginning with STRING, reattaching the prefix to reformatted lines
-s, --split-onlySplit long lines, but do not refill
-t, --tagged-paragraphIndentation of first line different from second
-u, --uniform-spacingOne space between words, two after sentences
-w, --width=WIDTHMaximum line width (default of 75 columns)
-g, --goal=WIDTHGoal width (default of 93% of width)
--helpDisplay this help and exit
--versionOutput version information and exit
Written by Ross Paterson.
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>
Copyright © 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Full documentation <https://www.gnu.org/software/coreutils/fmt>
or available locally via: info '(coreutils) fmt invocation'
GNU coreutils 8.32 January 2026 FMT(1)
```Generated by phpman v4.10.0-16-g1a0e228 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-22 19:26 @216.73.217.0
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)