ITeye博客

shell 交集、并集、差集

085567 · 2011-01-20 14:57 · linux · 操作系统 · Markdown

取两个文本的并、交、差集

并: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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。