Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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 . . .

share|improve this answer
    
Well diff -r dir1 dir2 already has expected output, thx. –  Deqing Nov 20 '12 at 2:02

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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