comm
- comm -12 <(sort 123|uniq) <(sort 234 | uniq) | wc -l 【comm -12 表示取消第一列和第二列的輸出,即只輸出第三列】
- comm命令可以求兩個文件的比較結果。默認輸出三列,分別表示A-B,B-A 和 A交B。
- comm命令要求輸入文件的內容必須是排序且唯一的
- https://www.xuebuyuan.com/1273561.html
grep
- 交集:grep -F -f file1 file2
- B-A:grep -F -v -f file1 file2
- A-B:grep -F -v -f file2 file1
- https://www.jianshu.com/p/cf428138caab