1

Normally I use meld to compare folders, however, it is not handy when a folder has many subfolders, because I have to click into each subfolder to see if there is any difference.

Is there a tool to compare folder that displays differences only?

2 Answers 2

2

A command line diff will do this, and a little grep would get you a list of different files, e.g.:

diff -r dir1 dir2 | grep -e "Only|diff"

Could obviously be improved . . .

1
  • Well diff -r dir1 dir2 already has expected output, thx.
    – Deqing
    Nov 20, 2012 at 2:02
2

For a nice visual side-by-side comparison I like to use two files of md5 checksums and vimdiff.

This has the added bonus of being to easy to compare two directories on two different servers.

It only shows you which files are different, not the internal differences.

To compare the /etc/ directories on servers sr1 and sr2:

(On first server:)

for i in (find /etc/ -print); do md5sum $i; done | awk '{print $2 "\t" $1}' | sort > 
~/tmp/etc-sr1.txt

(on second server:)

for i in (find /etc/ -print); do md5sum $i; done | awk '{print $2 "\t" $1}' | sort > 
~/tmp/etc-sr2.txt

scp ~/tmp/etc-sr2.txt sr1:tmp/etc-sr2.txt

(On first server:)

vimdiff ~/tmp/etc-sr1.txt ~/tmp/etc-sr2.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.