Formats mail messages prior to sending.
The fmt command starts a text formatter that reads the concatenation of input Files (or standard input if no Files are specified), then produces on standard output a version of the input with the line lengths set to the value of -Width. If no value is specified with the -Width flag, the default value of 72 characters is used. The spacing at the beginning of the input lines is preserved in the output, as are blank lines and spacing between words.
The fmt command is generally used to format mail messages to improve their appearance before they are sent. However, the fmt command may also be useful for simple formatting tasks. For example, within visual mode of a text editing program such as the vi editor, the command !}fmt formats a paragraph so that all lines are set to the value specified with the -Width flag. If no value is specified with the -Width flag, the default value of 72 characters is used. Standard text editing programs are more appropriate than fmt for complex formatting operations.
Item | Description |
---|---|
File | Specifies the name of the file to be formatted. |
-Width | Specifies the line length. The default value for Width is 72 characters. |
~| fmt
The ~| is entered at the left margin
of the message. After you issue the ~| fmt command, the message
is formatted. The word (continue) is displayed to indicate
that you can enter more information or send the message.fmt file1
In this example, the file file1 is
formatted and displayed on your screen.Item | Description |
---|---|
/usr/bin/fmt | Contains the fmt command. |