gpt4 book ai didi

linux - 使用Linux比较两个大文件?

转载 作者:太空宇宙 更新时间:2023-11-04 05:46:22 25 4
gpt4 key购买 nike

文件1:

asd
1
asdfg
2
asdasd

文件 2:

asd
asdfg
asdasd
123
12333

预期结果

1
2

当前结果

1
2
123
12333

awk:

awk 'NR==FNR{lines[$0];next} !($0 in lines)' file1 file2

awk 'NR==FNR{lines[$0];next} !($0 in lines)' file1 file2

如上所示,当前结果全部是重复数据。

最佳答案

comm -23 --nocheck-order file1 file2

关于linux - 使用Linux比较两个大文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57675091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com