linux比较txt差异

file1.txt&file2.txt的交集==============
cat file1.txt file2.txt | sort | uniq -d > file3.txt

file1.txt相对file2.txt的差集===========

cat file1.txt file3.txt | sort | uniq -u >file.txt

file2.txt相对file1.txt的差集===========
cat file2.txt file3.txt | sort | uniq -u >file.txt

file1.txt&file2.txt对称比较的差============
 cat file1.txt file2.txt | sort | uniq -u  > temp.txt

原文地址:https://www.cnblogs.com/qczy/p/13217565.html