我想找到两个文件之间的区别,然后只将差异放在第三个文件中。我看到了使用awk,diff和comm的不同方法。还有更多吗?找到unix中两个文件之间差异的最快方法?
例如。 Compare two files line by line and generate the difference in another file
例如, Copy differences between two files in unix
我需要知道的是找到所有分歧,并列出它们在一个文件下面的每个案件的最快方法 -
Case 1 - file2 = file1 + extra text appended.
Case 2 - file2 and file1 are different.
因为这取决于您的输入,它最好自己计算一下 – perreal
你能否让你的案例更具体一些,或者给出一些你尝试过的东西的代码示例? – asf107
对于案例2,有'cmp',它逐字节比较两个文件。 – micke