[CentOS] compare directories

William L. Maltby CentOS4Bill at triad.rr.com
Thu Oct 23 14:16:30 UTC 2008


On Thu, 2008-10-23 at 11:53 +0200, David Hláčik wrote:
> Hello guys,
> 
> I have two mirrors. I need to compare files and directories on both
> mirrors and as a result print list of those which are missing on
> mirror 2
> 
> What i did
> 
> find /data > find.mirror1
> 
> find /data > find.mirror2
> 
> Now i need to get list of those directories which are missing in
> mirror1.

diff --brief --recursive /dir1 /dir2 &> /tmp/dir1vsdir2 # good enough?

$ mkdir dir1 dir2
$ mkdir dir1/{a,b,c,d} dir2/{b,d}
$ diff --recursive --brief dir1 dir2
Only in dir1: a
Only in dir1: c
$

> 
> Thanks in advance!
> 
> David
> <snip sig stuff>

HTH
-- 
Bill



More information about the CentOS mailing list