Find duplicated files

,

check md5 between similarly named file (toto.ext and toto 2.ext)

for i in *2.???; do
  base=${i%.*}; 
  ext=${i##*.};
  baseclean=${base% 2};
  md5sum "$base.$ext";
  md5sum "$baseclean.$ext";
done;
while read line;
do
  name=`echo $line|cut -f2 -d\ `;
  ref=`echo $line| cut -f1 -d\ `;
  actual=`md5sum ./$name|cut -f1 -d\ `;
  if [ "$ref" != "$actual" ] then
    echo "file $name differ";
  fi;
done < ~/filelist.md5

Leave a Reply

Your email address will not be published. Required fields are marked *