public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Compare two directories, architecture only
@ 2012-03-29  9:26 Fergus
  2012-03-29 11:34 ` marco atzeri
  2012-03-30 17:05 ` Andrey Repin
  0 siblings, 2 replies; 4+ messages in thread
From: Fergus @ 2012-03-29  9:26 UTC (permalink / raw)
  To: Cygwin ML; +Cc: Fergus

Is there an easy way to compare two directories for content (names only 
of subdirectories and files, not their identical content).
(1) "diff" compares the content of files: too strong a comparison;
(2) Could "find" both directories and then compare output, but this will 
list the entire content under any non-matching subdirectories, when all 
I need is the fact of the non-match.
(i.e. I need
diff -rq d1 d2 | sed ' /^Files /d'    OR    diff -rq d1 d2 | grep '^Only'
without the scrutiny of file content that diff provides.)
Thank you!
Fergus

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compare two directories, architecture only
  2012-03-29  9:26 Compare two directories, architecture only Fergus
@ 2012-03-29 11:34 ` marco atzeri
  2012-03-30 17:05 ` Andrey Repin
  1 sibling, 0 replies; 4+ messages in thread
From: marco atzeri @ 2012-03-29 11:34 UTC (permalink / raw)
  To: cygwin

On 3/29/2012 11:25 AM, Fergus wrote:
> Is there an easy way to compare two directories for content (names only
> of subdirectories and files, not their identical content).
> (1) "diff" compares the content of files: too strong a comparison;
> (2) Could "find" both directories and then compare output, but this will
> list the entire content under any non-matching subdirectories, when all
> I need is the fact of the non-match.
> (i.e. I need
> diff -rq d1 d2 | sed ' /^Files /d' OR diff -rq d1 d2 | grep '^Only'
> without the scrutiny of file content that diff provides.)
> Thank you!
> Fergus

not clear what are you looking for, just if the two trees are equal or
also the list of the differences (missing files) ?

cd dir1 ; find . -type f > /tmp/list1
cd dir2 ; find . -type f > /tmp/list2

then or
cmp /tmp/list1 /tmp/list2
or
diff -uN /tmp/list1 /tmp/list2

Regards
Marco






--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compare two directories, architecture only
  2012-03-29  9:26 Compare two directories, architecture only Fergus
  2012-03-29 11:34 ` marco atzeri
@ 2012-03-30 17:05 ` Andrey Repin
  2012-03-30 18:48   ` Earnie Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Andrey Repin @ 2012-03-30 17:05 UTC (permalink / raw)
  To: Fergus, cygwin

Greetings, Fergus!

> Is there an easy way to compare two directories for content (names only 
> of subdirectories and files, not their identical content).

What you want it for? If you only need it for your own convenience, you can
use compare tool included in file managers like Wincommander or Far Manager.

> (1) "diff" compares the content of files: too strong a comparison;
> (2) Could "find" both directories and then compare output, but this will 
> list the entire content under any non-matching subdirectories, when all 
> I need is the fact of the non-match.
> (i.e. I need
> diff -rq d1 d2 | sed ' /^Files /d'    OR    diff -rq d1 d2 | grep '^Only'
> without the scrutiny of file content that diff provides.)


--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 30.03.2012, <20:54>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compare two directories, architecture only
  2012-03-30 17:05 ` Andrey Repin
@ 2012-03-30 18:48   ` Earnie Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Earnie Boyd @ 2012-03-30 18:48 UTC (permalink / raw)
  To: Andrey Repin

On Fri, Mar 30, 2012 at 12:55 PM, Andrey Repin wrote:
> Greetings, Fergus!
>
>> Is there an easy way to compare two directories for content (names only
>> of subdirectories and files, not their identical content).

ls -1 dir1 > /tmp/dir1.out && ls -1 dir2 > /tmp/dir2.out && diff -u
/tmp/dir1.out /tmp/dir2.out

>
> What you want it for?

Who cares?  This was a simple question that has a simple answer.
Fergus will let you know if it isn't what he wanted. ;D

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-30 18:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29  9:26 Compare two directories, architecture only Fergus
2012-03-29 11:34 ` marco atzeri
2012-03-30 17:05 ` Andrey Repin
2012-03-30 18:48   ` Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).