How do I compare two source trees in Linux?

Viewed 44726

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?

5 Answers

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.

You can try Meld. It is a wonderful visual diff tool ;-)

diff -u -r dirA dirB

Will show you a unified recursive diff between the files in dirA and dirB

You may use the diff command in the shell. Or install a tool like KDiff3.

Related