Is there a standard Linux tool that looks for similarities between two files? The diff
tool works best comparing files that are mostly the same, and outputs where they differ. I'm looking for a tool to compare files that are mostly different, and output their similarities.
-
Some good answers at SO– RedGrittyBrickCommented Aug 8, 2012 at 16:08
Add a comment
|
2 Answers
comm -12 file1 file2
will print the lines that exist in both files; I think it only works for sorted files, though.
-
The files won't be sorted, but I think this is going to be my best option. Commented Aug 8, 2012 at 17:26
You mught try using vimdiff
or gvimdiff
. However, they too find differences raather than similarities.
I doubt an application for what you suggested exists.
-
Yeah, I use
vimdiff
a lot. These files are too different for that to be useful though. Commented Aug 8, 2012 at 14:43