3

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.

1

2 Answers 2

3

comm -12 file1 file2 will print the lines that exist in both files; I think it only works for sorted files, though.

1
  • The files won't be sorted, but I think this is going to be my best option. Commented Aug 8, 2012 at 17:26
1

You mught try using vimdiff or gvimdiff. However, they too find differences raather than similarities. I doubt an application for what you suggested exists.

1
  • Yeah, I use vimdiff a lot. These files are too different for that to be useful though. Commented Aug 8, 2012 at 14:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .