Comments on Linux fmt Command - Usage and Examples

Sometimes you may find yourself in a situation where-in the requirement is to format the contents of a text file. Gladly, there exists a command that can cater to at-least some of the text formatting requirements. The tool in question is dubbed fmt. In this tutorial, we will discuss the basics of fmt, as well as some of main features it provides.

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Pete at: 2017-09-19 00:01:24

There is nothing wrong with a tool that does one thing, well.  Especially if it behaves as a filter.

By: Eko at: 2020-04-28 14:18:01

Oh my, without even trying to understand the `fmt' tool, I invoke `fmt file-name.txt > file-name.txt' and now the file-name.txt has been rewritten as an empty file.

Ahhh, I have just lost several hours of work because of my stupidity. My mistake!