When I run fdupes
it finds more than 30,000 duplicate files. I need to keep one file and delete all the other duplicates (because some of them are systemfiles). Please give me a command or script to do this without pressing "1 or 2 or all" for each and every group of duplicate files.
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
has a rich CLI: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.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.I would use this safer way:
Create a script and move the duplicated files to a new folder. If you move to a folder outside the original folder, fdupes won't report the duplicated files on a second scan, and it will be safer to delete them.
I have used fslint and DupeGuru for quite some time.
Both can handle >10000 files/folders
I have tried them all, diff, fdupes, rsync, rdfind shell scripts and without a doubt fslint beats them all hands down. It shows the duplicates, allows you to examine them and merge or delete. The GUI is very clean and easy to use. I'm using Ubuntu 20.04.