1. Intersection: Find out the duplicate content of A.txt and B.txt:
cat A.txt B.txt |sort -n |uniq -d> same.txt
2、差集:A.txt 去掉 same.txt的内容:
cat A.txt same.txt |sort -n |uniq -u > new.txt
3. Union: Summarize the contents of the two files
cat a.txt b.txt | sort -u > new.txt