比较两个已排过序的文件的命令comm
There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.
The blog content is all parallel goods. Those who are worried about being cheated should leave quickly.
比较两个已排过序的文件,并将其结果显示出来。
comm [-123] [--help] [file1] [file2]
-1 不显示只在第1个文件里出现过的列。
-2 不显示只在第2个文件里出现过的列。
-3 不显示只在第1和第2个文件里出现过的列。
比较文件file1和file2.
#cat file1
a
aa
#cat file2
a
bb
#comm file1 file2
a
aa
bb
比较文件file1和file2,只显示file1和file2中共有的行。
#comm -12 file1 file2
a