Register
It is currently Sat Dec 20, 2014 10:44 am

How to delete duplicate files ?


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Jun 04, 2007 11:52 am   

Joined: Mon Jun 04, 2007 11:30 am
Posts: 3
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,

Code:
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.


Top
 Profile  
 PostPosted: Mon Jun 04, 2007 1:30 pm   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
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.


Top
 Profile YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP