How to compare two source trees in Linux?


I have two directories containing source files to a project I've inherited with little by way of documentation. How do I compare both directories to make see what the differences are?

Best Solution

Try this:

diff -Naur dir1/ dir2/
  • The -u option makes the output a little easier to read.
  • The -r option recurses through all subdirectories
  • The -N and -a options are really only necessary if you wanted to create a patch file.