This is the mail archive of the
mailing list for the Cygwin project.
Re: Compare two directories, architecture only
- From: marco atzeri <marco dot atzeri at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 29 Mar 2012 13:33:59 +0200
- Subject: Re: Compare two directories, architecture only
- References: <4F742A9E.firstname.lastname@example.org>
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.)
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
cmp /tmp/list1 /tmp/list2
diff -uN /tmp/list1 /tmp/list2
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple