[sclug] Getting rid of duplicate files

Ed Davies sclug at edavies.nildram.co.uk
Thu Sep 28 13:13:28 UTC 2006


Tim Sutton wrote:
> ... 
> Then I ran this little script to build md5 checksums:
> 
>        1 PICFILE=/tmp/pictures$$.txt
>        2 MD5FILE=/tmp/md5$$.txt
>        3 find ~/Pictures/ -type f >> ${PICFILE}
>        4 while read LINE
>        5 do
>        6   md5sum "${LINE}" >> ${MD5FILE}
>        7 done < $PICFILE
> ...

I realise you're very unlikely to find an existing /tmp/md5$$.txt
for the current process id but, just in case, I'd feel more comfortable
deleting it first otherwise one could wind up thinking all the
images are duplicates and deleting the lot, or something.

Ditto, don't see the point of append rather than straight redirection
to ${PICFILE}.

Ed.



More information about the Sclug mailing list