Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jack Strangio Newsgroups: comp.os.linux.misc Subject: Re: Compare 2 dir-TREES? Date: Thu, 1 Jan 2015 03:31:30 GMT Organization: North Star Horizon Builders Club Lines: 41 Message-ID: References: Injection-Info: mx02.eternal-september.org; posting-host="3e657bdea6b7aef1ac09b31dcca154f6"; logging-data="1931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+soWawAKwr60DSy4+wwgwpvzvPsXA77nY=" X-Newsreader: TASS News Reader 3.7.2 jvs [linux] Cancel-Lock: sha1:k3NhkTIRJaUNNN5gR1kbyXnBya0= Xref: csiph.com comp.os.linux.misc:13153 Unknown 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 ` <-- 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