If I want find the differences between two directory trees, I usually just execute:
diff -r dir1/ dir2/
This outputs exactly what the differences are between corresponding files. I'm interested in just getting a list of corresponding files whose content differs. I assumed that this would simply be a matter of passing a command line option to diff
, but I couldn't find anything on the man page.
Any suggestions?
The command I use is:
It is exactly the same as Mark's :) But his answer bothered me as it uses different types of flags, and it made me look twice. Using Mark's more verbose flags it would be:
I apologise for posting when the other answer is perfectly acceptable. Could not stop myself... working on being less pedantic.
Channel compatriot 'billings' (of freenode/#centos fame) shared his method with me:
Including the final directory forward slash doesn't matter.
Also, it appears the
-u
option is not available on some older/server versions of diff.The difference in diffs:
Meld is also a great tool for comparing two directories:
meld dir1/ dir2/
Meld has many options for comparing files or directories. If two files differ, it's easy to enter file comparison mode and see the exact differences.