In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the use of linux diff command to compare the differences of files, has a certain reference value, friends in need can refer to. Let's take a look at it with me.
Diff compares the similarities and differences of text files line by line. If you specify to compare directories, diff compares files with the same filename in the directory, but not their subdirectories.
Syntax format: diff [parameters] [directory]
Common parameters:
The-adiff preset only compares text files line by line-b does not check for differences in space characters-W specifies the column width-x does not compare the file or directory specified in the option-X you can save the file or directory type as a text file, and then specify this text file-y to display the similarities and differences of the file in a side-by-side manner in =-help view help information-left-column when using the-y parameter If one line of the two files is the same, the line is displayed only in the field on the left-suppress-common-lines shows only the differences when using the-y parameter
Reference example
Compare two files:
[root@linuxcool ~] # diff log2014.log log2013.log
Side-by-side format output:
[root@linuxcool] # diff log2014.log log2013.log-y-W 502013-012013-012013-02 2013-022014-03 | 2013-032013-042013-042013-052013-052013-062013-062013-072013-072013-07 | | 2013-082013-092013-092013-102013-102013-11-12 |
Note: "|" indicates that the contents of the two files are different, and "" indicates that the latter file has one more line of content than the previous file.
These are the details of using linux's diff command to compare the differences in files. Do you have anything to gain after reading it? If you want to know more about it, welcome to the industry information!
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.