Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .