2025-03-14 21:59:59 -06:00
|
|
|
# fmt
|
|
|
|
|
|
|
|
|
|
> Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).
|
|
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/fmt-invocation.html>.
|
|
|
|
|
|
|
|
|
|
- Reformat a file:
|
|
|
|
|
|
|
|
|
|
`fmt {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Reformat a file producing output lines of (at most) `n` characters:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`fmt {{[-w|--width]}} {{n}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Reformat a file without joining lines shorter than the given width together:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`fmt {{[-s|--split-only]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs):
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`fmt {{[-u|--uniform-spacing]}} {{path/to/file}}`
|