Home > Articles

  • Print
  • + Share This
This chapter is from the book

fmt

The fmt command performs simple formatting of text data. Important options include the following:

Option Description
-u Changes the document so there is only one space between each word and two spaces after each sentence.
-w Used to specify the maximum number of characters in each line.

Example:

[student@localhost ~]$ cat data.txt
pam_motd — Display the motd file

DESCRIPTION

pam_motd is a PAM module that can be used to display arbitrary motd
(message of the day) files after a successful login. By default
the /etc/motd file is shown. The message size is limited to 64KB.

[student@localhost ~]$ fmt -w 40 data.txt
pam_motd — Display the motd file

DESCRIPTION

pam_motd is a PAM module that can be
used to display arbitrary motd (message
of the day) files after a successful
login. By default the /etc/motd file
is shown. The message size is limited
to 64KB.
  • + Share This
  • 🔖 Save To Your Account