Once a geek, forever a geek…

Find duplicate files

| 1 Comment

How to find those files that have different names but exactly the same content?

You could install the good fdupes or you could just reinvent the wheel with bash, md5sum and awk:

find path/ -type f | xargs md5sum | awk '{
	sub("[^/]*/","",$2);
	if (cache[$1])
		print "Found: "cache[$1],$2;
	else
		cache[$1]=$2
}'

path is where you want to search for duplicates. You can limit the search with the find maxdepth option.

Related Posts

Author: Marius Voila

Hi! My name is Marius Voila, and I am a professional system administrator, system architect, and designer.

One Comment

  1. Pingback: Tweets that mention Find duplicate files | Once a geek, forever a geek... -- Topsy.com

Leave a Reply

Required fields are marked *.

*