shell 交集、并集、差集

取两个文本的并、交、差集
并:sort -m <(sort file1 | uniq) <(sort file2 | uniq) | uniq
交:sort -m <(sort file1 | uniq) <(sort file2 | uniq) | uniq -d
差:sort -m <(sort file1 | uniq) <(sort file2 | uniq) <(sort file2 | uniq) | uniq -u

猜你喜欢

转载自baiyunl.iteye.com/blog/889869