Search and remove duplicate files

Here a small piece of code which will search for the duplicates in the path you supply. It will generate a new file which contains the commands for deleting those duplicates.
Make sure you double check the resulting file!
The script requires that you have fdupes installed.
Install it in Ubuntu/Debian by running the following command in your terminal:

sudo aptitude install fdupes
echo "#!/bin/bash" > $OUTF
fdupes -r -f $1 | sed -r 's#(.+)#rm '\"'\1'\"'#' >> $OUTF
chmod +x $OUTF

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.