1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 09:42:07 +02:00
tldr/pages/common/fmt.md
2025-01-18 07:37:57 +01:00

605 B

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:

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}}