How to delete duplicate files ?
Page 1 of 1

Author:  jimmy [ Mon Jun 04, 2007 11:52 am ]
Post subject:  How to delete duplicate files ?

i have been trying to write a script for deleting all duplicate files under the current directory after user confirmation and i could manage to reach upto this point,

find .  -maxdepth 1 -type f  -print0 | xargs -0 md5sum | sort | uniq -w 32 -c  |
awk '{ print $1, $3 }' ;

i need guidance after this. Please help.

Author:  jeo [ Mon Jun 04, 2007 1:30 pm ]
Post subject: 

Hi again Jimmy, Welcome to the forums!

I see what you did there...

So far you've got a list of file names and the number of occurences.

When the md5sum is the same, and the names are different, it seems like you only get the last name of the last occurence. You'll probably want to generate a list and iterate through it asking for user confirmation for each one or something... I'll have to experiment.

Page 1 of 1 All times are UTC - 6 hours
© 2000, 2002, 2005, 2007 phpBB Group •