取两个文本的并、交、差集
并: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
交:sort -m <(sort file1 | uniq) <(sort file2 | uniq) | uniq -d
差:sort -m <(sort file1 | uniq) <(sort file2 | uniq) <(sort file2 | uniq) | uniq -u
本文介绍如何使用命令行工具处理文本文件的并集、交集及差集。通过sort和uniq等命令组合实现对两个文本文件进行集合运算的方法。
6104

被折叠的 条评论
为什么被折叠?



