How to delete duplicate files with fdupes?
You can do this if you want to run this silently (I've just used it to clear 150 GB of dupes running on rackspace block storage ..£kerching!!)
fdupes -rdN dir/
r - recursive
d - preserver first file, delete other dupes
N - run silently (no prompt)
fdupes
has a rich CLI:
fdupes -r ./stuff > dupes.txt
Then, deleting the duplicates was as easy as checking dupes.txt
and deleting the offending directories. fdupes
also can prompt you to delete the duplicates as you go along.
fdupes -r /home/user > /home/user/duplicate.txt
Output of the command goes in duplicate.txt
.
fdupes
will compare the size and MD5 hash of the files to find duplicates.
Check the fdupes
manpage for detailed usage info.