比较 UNIX 中的两个文件 [英] compare two files in UNIX

查看:26
本文介绍了比较 UNIX 中的两个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想比较两个文件 [未排序]文件 1 和文件 2.无论行号如何,我都想做 file2 - file1 [差异]?diff 不起作用.

I would like to compare two files [ unsorted ] file1 and file2. I would like to do file2 - file1 [ the difference ] irrespective of the line number? diff is not working.

推荐答案

我通过使用 comm 得到了解决方案

I got the solution by using comm

comm -23 file1 file2 

会给你想要的输出.

无论如何都需要先对文件进行排序.

The files need to be sorted first anyway.

这篇关于比较 UNIX 中的两个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆