#!/bin/bash
#dupfind.sh
#author: myownshadow
#TODO:
#needs find redirecting without for loop (find invokes subshells)
#need a faster checksum, md5sum can be very slow with big files
for ind in `find $1 -type f -print0 | xargs -0 md5sum |sed s/\ /-/g`
do
echo $ind >> .md5list &2>/dev/null
done
cat .md5list|cut -c1-32| sort| uniq -d >> .duplist
for line in `cat .duplist`
do
cat .md5list | grep $line | cut -c35-
done
rm .md5list
rm .duplist
exit
Kullanım:
$dupfind.sh /media/iPOD
Tags: bash, checksum, duplicate file, md5, scripting
This entry was posted
on Thursday, February 18th, 2010 at 16:00 and is filed under Yazılım.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Cevap veya Yorum Yaz