Compare 2 directories

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 30, 2008
122
1
#1
I want to compare 2 directories to see where they differ. Essentially,
see which files and/or directories are only in one place (if directory
X is only in one, I don't need to see all the files within that
directory reported as well).

The nearest I can get is SYNC /S /E /N, but that reports file-by-file,
even for directories that are completely missing.

Using external tools, Gnu diff gets me partway there, diff -qr reports
differences, but doesn't say which are files and which are
directories.

Is there a way of doing this that I've missed? It seems a simple
enough thing that I need, but it's harder than I'd expect to find a
good solution :-(

Thanks,
Paul.
 

samintz

Scott Mintz
May 20, 2008
1,204
11
Solon, OH, USA
#2
Have you looked at WinMerge yet? It does a very good job at both file and
directory differencing. It integrates with ClearCase. And it's free (my
favorite price).

-Scott

"p.f.moore" <> wrote on 08/13/2008 09:34:38 AM:


> I want to compare 2 directories to see where they differ. Essentially,
> see which files and/or directories are only in one place (if directory
> X is only in one, I don't need to see all the files within that
> directory reported as well).
>
> The nearest I can get is SYNC /S /E /N, but that reports file-by-file,
> even for directories that are completely missing.
>
> Using external tools, Gnu diff gets me partway there, diff -qr reports
> differences, but doesn't say which are files and which are
> directories.
>
> Is there a way of doing this that I've missed? It seems a simple
> enough thing that I need, but it's harder than I'd expect to find a
> good solution :-(
>
> Thanks,
> Paul.
>
 
#3
If you've got Microsoft Visual Studio, within the Visual SourceSafe IDE
is a comparison tool that is ordinarily used to compare files or
directories to corresponding files or folders within VSS. Oddly enough,
however, it can also be used to compare items, neither of which are in
VSS. When comparing folders recursively, it will do exactly what you
want, I believe.

I can't believe I just recommended something within VSS, since for most
other things, VSS is a pretty poor SCM tool.

Oh, and for general file and directory compare utilities, I highly
recommend two completely different and free utilities. One is CSDiff,
from ComponentSoftware. It comes bundled as part of their CS-RCS tool
(a GUI for RCS) which is also free for limited uses and not free for
enterprise environments, but CSDiff is also available independently and
completely free. See http://www.componentsoftware.com/products/csdiff/
for more information.

The second free comparison utility I also like is SourceGear DiffMerge. I've been using CSDiff
for many years and really like it, but it had a few shortcomings. I
went and found DiffMerge and have been using it for a little while and
found it quite good as well.

I have no stake in either of the freeware utilities mentioned above.
I'm just a satisfied user.

________________________________

From: p.f.moore [mailto:]
Sent: Wednesday, August 13, 2008 6:35 AM
To: Mickey Ferguson
Subject: [Support-t-389] Compare 2 directories

I want to compare 2 directories to see where they differ. Essentially,
see which files and/or directories are only in one place (if directory
X is only in one, I don't need to see all the files within that
directory reported as well).

The nearest I can get is SYNC /S /E /N, but that reports file-by-file,
even for directories that are completely missing.

Using external tools, Gnu diff gets me partway there, diff -qr reports
differences, but doesn't say which are files and which are
directories.

Is there a way of doing this that I've missed? It seems a simple
enough thing that I need, but it's harder than I'd expect to find a
good solution :-(
 
May 30, 2008
122
1
#4
2008/8/13 MickeyF <>:

> If you've got Microsoft Visual Studio
[...]

> Oh, and for general file and directory compare utilities, I highly
> recommend two completely different and free utilities.
I didn't make this clear, but I'm really after command line answers.
And specifically, is there anything native in TCC (I have Gnu diff if
I need an external utility).

Thanks for the suggestions anyway.
Paul.
 
May 30, 2008
42
0
#5
From: p.f.moore
Sent: Wednesday, August 13, 2008 12:24 PM
Subject: RE: [Support-t-389] Compare 2 directories

>
> I didn't make this clear, but I'm really after command line answers.
> And specifically, is there anything native in TCC (I have Gnu diff if
> I need an external utility).
Try this:

http://israel.logiclrd.cx/

It's a quick hack that I just threw together, but it worked for a little
test case I created.

Jonathan Gilbert
 
May 30, 2008
122
1
#7
2008/8/15 logic <>:

>> I didn't make this clear, but I'm really after command line answers.
>> And specifically, is there anything native in TCC (I have Gnu diff if
>> I need an external utility).
> ---End Quote---
> Try this:
>
> http://israel.logiclrd.cx/
Did I miss something? I can't see which of the links on that page relates.
Paul.