linux文件交集差集
2016-08-28 21:14
288 查看
linux文件交集差集
目录(?)[+]comm命令:
comm file1 file2
在没有指定可选参数,默认会输出三列: 只在file1中的数据,只在file2中的数据以及file1和file2的交集。也可以指定如下参数:
[plain] view
plain copy
-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)
e.g.
[plain] view
plain copy
cat a.txt
a
b
c
d
e
f
[plain] view
plain copy
cat b.txt
a
b
c
e
w
[plain] view
plain copy
comm a.txt b.txt
a
b
c
d
e
f
w
求两个文件的交集
[plain] viewplain copy
comm -12 a.txt b.txt
a
b
c
e
求两个文件的差集
在file2不在file1中的数据[plain] view
plain copy
comm -13 a.txt b.txt
w
在file1不在file2中的数据
[plain] view
plain copy
comm -23 a.txt b.txt
d
f
相关文章推荐
- linux中2个文件的并集,交集,差集
- Linux 求文件交集 差集等
- Linux文件比较,文本文件的交集、差集与求差
- Linux 两个文件求交集、并集、差集
- linux文本排序、交集、差集,查找并删除重复文件脚本、comm命令
- linux求两个文件的交集,并集,差集
- 第二十二章 Linux文件比较,文本文件的交集、差集与求差:comm命令
- Linux文件比较操作---文本文件的交集、差集与求差
- linux文件交集差集
- linux命令求两个文件的交集、差集、并集等
- Linux 求文件交集 差集等
- linux_coom _ Linux文件比较,文本文件的交集、差集与求差
- Linux 两个文件求交集、并集、差集
- 用uniq来处理文件重复数据--交集,差集,计数等(转)
- 利用linux命令sort和uniq求两个文件的交集并集和补集
- 文件交集差集等等随笔
- shell中使用sort和uniq实现两文件的并集,交集和差集
- python 对中文文件求交集、并集、差集
- Linux求文件差集
- linux ---用uniq实现文件的并集和交集