2019-02-08 10:44:08 +00:00
|
|
|
# fmt
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
> Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/fmt>.
|
2019-02-08 10:44:08 +00:00
|
|
|
|
|
|
|
- Reformat a file:
|
|
|
|
|
|
|
|
`fmt {{path/to/file}}`
|
|
|
|
|
|
|
|
- Reformat a file producing output lines of (at most) `n` characters:
|
|
|
|
|
|
|
|
`fmt -w {{n}} {{path/to/file}}`
|
|
|
|
|
|
|
|
- Reformat a file without joining lines shorter than the given width together:
|
|
|
|
|
|
|
|
`fmt -s {{path/to/file}}`
|
|
|
|
|
|
|
|
- Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs):
|
|
|
|
|
|
|
|
`fmt -u {{path/to/file}}`
|