In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will show you how to format text files using linux's fmt command. There is a certain reference value, there are friends in need can refer to, I hope to help you.
The fmt command reads the contents from the specified file, reformats them according to the specified format, and outputs them to the standard output device. If the file name specified is "-," the fmt command reads data from a standard input device.
Syntax format: fmt [parameter] [file]
Common parameters:
-c Indent the first two columns of each paragraph-s Only break columns with more characters than each column, but do not merge columns with fewer characters-t Indent the first two columns of each column, but the indentation format for the first and second columns is different-u Each character is separated by a space character, and each sentence is separated by two space characters-w Sets the maximum number of characters per column
Reference Example
Rearrange specified files. If file has 5 lines of text, you can rearrange the file format by commanding:
[root@linuxcool ~]# fmt file
Rearrange file to 85 characters:
[root@linuxcool ~]# fmt -w 85 file
Have fmt highlight the first line:
[root@linuxcool ~]# fmt -t file
Split long rows with fmt:
[root@linuxcool ~]# fmt -s file
Space between words and sentences:
[root@linuxcool ~]# fmt -u file The above is a brief introduction to using the linux fmt command to arrange text files. Of course, the differences in using the above in detail must be understood by everyone themselves. If you want to know more, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.