fmt - linux command line

Опубликовано: 24 Июль 2026
на канале: Edik Mkoyan
923
12

Reformatting Paragraphs with fmt
Sometimes text files arrive with outrageously long line lengths, irregular line lengths, or other problems. Depending on the difficulty, you may be able to cope simply by using
an appropriate text editor or viewer to read the file. If you want to clean up the file a bit, though, you can do so with fmt. If called with no options (other than the input filename, if you’re not having it work on standard input), the program attempts to clean up paragraphs, which it assumes are delimited by two or more blank lines or by changes in indentation. The new paragraph formatting defaults to no more than 75 characters wide. You can change this with the -width, -w width, or --width=width options, which set the line length to width characters.