commands.sh

fmt

all

Reformat a text file by joining its paragraphs and limiting the line width to a number of characters (75 by default).

More info →

Options (3)

-w, --widthboolean

Reformat a file producing output lines of (at most) `n` characters

Example: fmt {{[-w|--width]}} {{n}} {{path/to/file}}
-s, --split-onlyboolean

Reformat a file without joining lines shorter than the given width together

Example: fmt {{[-s|--split-only]}} {{path/to/file}}
-u, --uniform-spacingboolean

Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs)

Example: fmt {{[-u|--uniform-spacing]}} {{path/to/file}}

Examples (4)

Reformat a file

fmt path/to/file

Reformat a file producing output lines of (at most) `n` characters

fmt [-w|--width] n path/to/file

Reformat a file without joining lines shorter than the given width together

fmt [-s|--split-only] path/to/file

Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs)

fmt [-u|--uniform-spacing] path/to/file
made by @shridhargupta | data from tldr-pages