c++ - 比较两个文件,找到差异吗?

标签 c++ linux bash file compare

我有两个具有以下结构的文件。

文件A:

asd
fds
sdf
asdf

文件B:

asd
sdf

我想找出这两个文件之间的区别。

这次结果应该是fds, asdf

如何使用 C++ 或 Linux 来实现?

最佳答案

diff A B 返回

2d1
< fds
4d2
< asdf

关于c++ - 比较两个文件,找到差异吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17517854/

相关文章:

c++ - 在 C++ 中将节点附加到树(引用和指针帮助。)

linux - 一个文件输入到脚本中的两个程序

shell - 命令/别名可以可变吗?

linux - 如何从列表中删除除其他特定模式文件之外的某些模式文件?

c++ - 在类中有类对象

c++ - Visual Studio 2015 "Hello World"多个错误

c++ - 有关简单C++函数的逻辑的问题(is_palindrome)

linux - 如何在ansible中获得一个随机未使用的端口

linux - 无法独占打开/dev/sda2。挂载的文件系统?

arrays - 将目录时间戳插入 bash 中按日期排序的数组