diff的相反方法? [英] How to do the opposite of diff?

查看:114
本文介绍了diff的相反方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何显示共同的线(反向差异)?

是否有命令执行diff的相反操作?如果两个文件中都存在相同的文件,我想比较两个文件。我试图找出两个文件中都存在什么条目。

Is there a command to do the opposite of diff? I want to compare two files if the same thing exists in both create a list of them. i am trying to figure out what entry's exist in both files.

推荐答案

这里是一种不会更改顺序的解决方案行:

Here is a solution that WILL NOT change the order of the lines:

fgrep -x -f file1 file2

这篇关于diff的相反方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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