Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #13153

Re: Compare 2 dir-TREES?

From Jack Strangio <jackstrangio@yahoo.com>
Newsgroups comp.os.linux.misc
Subject Re: Compare 2 dir-TREES?
Date 2015-01-01 03:31 +0000
Organization North Star Horizon Builders Club
Message-ID <nHHB4I.9Ft@yahoo.com> (permalink)
References <pan.2015.01.01.02.56.21@gmail.com>

Show all headers | View raw


Unknown <dog@gmail.com> writes:
> I can't find how to do this common task!
> `du | wc -l` will show the NUMBER of files - I think?
> 
> -> rsync --list-only /mnt/p15/usr/X11R6/DumyDirTstRsync 
>            /usr/X11R6/DumyDirTstRsync
> == drwxr-xr-x        4096 2014/12/31 18:46:24 DumyDirTstRsync 
> == ! does NOT tell WHAT differences !!
> 
> So: `rsync --list-only <Tree1> <Tree2>`  <-- FAILS !!
> 
> What am I doing wrong, for this simple/common task?
There are several ways. I use this quick n dirty but effective method:

to compare directory trees A and B -

cd /A
find . -type f | sort > /tmp/Afiles
cd /B
find . -type f | sort > /tmp/Bfiles


then to find the extra A files

diff /tmp/Afiles /tmp/Bfiles | grep '< ' > /tmp/Aextras

and to find the extra B files


diff /tmp/Afiles /tmp/Bfiles | grep '> ' > /tmp/Bextras



Jack


-- 
"I'm a home-loving girl. And that's where I wish I was."
"At home ..."
"Loving."
               - Laugh-In, 1968

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Compare 2 dir-TREES? Unknown <dog@gmail.com> - 2015-01-01 02:49 +0000
  Re: Compare 2 dir-TREES? Robert Heller <heller@deepsoft.com> - 2014-12-31 21:25 -0600
  Re: Compare 2 dir-TREES? Jack Strangio  <jackstrangio@yahoo.com> - 2015-01-01 03:31 +0000
    Re: Compare 2 dir-TREES? Rich <rich@example.invalid> - 2015-01-02 21:39 +0000

csiph-web