Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 May 1999 02:46:35 +1000 (EST)
From:      Andy Farkas <andyf@speednet.com.au>
To:        Edwin Culp <eculp@MexComUSA.net>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: duplicate file finder
Message-ID:  <Pine.BSF.4.05.9905100237480.15256-100000@backup.zippynet.iol.net.au>
In-Reply-To: <3735B2EE.A0D14B2B@MexComUSA.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 9 May 1999, Edwin Culp wrote:

> Andy Farkas wrote:
> 
> > Does anyone know of a proggy that finds duplicate files?
> >
> 
> I often use find with a -exec cksum {} ;  with pipes to awk, sort and/or
> uniq depending on what I really want to do and how large the directory
> structure is.

Yes, I've managed to put two one-liners together to get what I want:

# find . -type f -exec md5 "{}" \; | awk '{printf "%s %s\n", $4, $2}'   \
    | sort > md5-list

# find . -type f -exec md5 "{}" \; | awk '{print $4}'   \
    | sort | uniq -d | grep -f - md5-list

> 
> ed
> 
> P.S. md5 would also work but is slower.
> 

--
 
 :{ andyf@speednet.com.au
  
        Andy Farkas
    System Administrator
   Speed Internet Services
 http://www.speednet.com.au/
  




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9905100237480.15256-100000>