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

I want to see, recursively, files that are different in two directories. Diff can do this, but it shows me the line-by-line differences, which I don't want. Is there a tool that does this, or a way to do this with Diff ( I read the man page, I didn't see anything ) ?

share|improve this question
    
Just following up; did diff -rq work for you, or did you need something else? – rob Oct 23 '09 at 23:12
up vote 27 down vote accepted

What about

diff -rq DIR1 DIR2

or

diff -rqb DIR1 DIR2

-r is recursive

-q is for brief, and will just tell you if the files are different (i.e., it won't show the line-by-line differences)

-b ignores whitespace

share|improve this answer
1  
-b ignores white space changes. Use -q or --brief for the brief option. – Doug Harris Oct 9 '09 at 18:59
    
And I've just upvoted this. I just tried the brief option for the first time. It's very nice output -- shows not just which files are different but identifies which files exist in one directory and not the other. – Doug Harris Oct 9 '09 at 19:02
    
Thanks Doug; I guess I originally had my option rotated 180 degrees. ;) Fixed now. – rob Oct 9 '09 at 21:18

You're looking for the -q option:

dlamblin$ diff -r a b
diff -r a/a b/a
0a1,2
> 
> 
Only in b: b
dlamblin$ diff -qr a b
Files a/a and b/a differ
Only in b: b
share|improve this answer

One way to do this is to do

diff dir1 dir1| grep "diff "

It will still do a line-by-line comparison, but each file comparison begins with "diff dir1/file dir2/file", so grepping "diff " will show only those lines ( i.e. the files that are different ).

share|improve this answer

If you're an emacs user, check out ediff-directories. You can see the file differences and then drill down into line-by-line differences if you need to see why they're different.

share|improve this answer

You must log in to answer this question.

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