Re: compare directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux