In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 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 comm command to compare two ordered files, the article is very detailed, has a certain reference value, interested friends must read it!
The comm command will compare the differences between the two sorted files in a column and display the results. If no parameters are specified, the results will be divided into three lines: the first line is only the column that appeared in the first file, the second line is the column that only appeared in the second file, and the third line is the column that appeared in both the first and second files. If the file name given is "-", the comm instruction reads the data from the standard input device.
Syntax format: [parameters] [File 1] [File 2]
-1 does not show columns that appear only in the first file-2 does not show columns that appear only in the second file-3 does not show columns that appear only in the first and second files-help online help-version displays version information
Reference example
Compare the files filename1.txt and filename2.txt:
[root@linuxcool ~] # comm filename1.txt filename2.txt
To print the intersection of two files, you need to delete the first and second columns:
[root@linuxcool] # comm filename1.txt filename2.txt-1-2
Print out different lines in the two files, and you need to delete the third column:
[root@linuxcool ~] # comm filename1.txt filename2.txt-3 | sed's / ^\ tUnigram'
Compared to the difference set of filename2.txt,filename1.txt:
[root@linuxcool] # comm filename1.txt filename2.txt-2-3
Compared to the difference set of filename1.txt,filename2.txt:
[root@linuxcool] # comm filename2.txt filename1.txt-2-3 above is to use linux's comm command to compare all the contents of two sequenced files. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.