Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When i run fdupes ,it finds more than 30,000 of duplicate files.I need to keep one file and delete all 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.

share|improve this question

4 Answers 4

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.

share|improve this answer
    
I found a way. yes 1 | fdupes -rd /mnt/hda5/midi_files –  user84055 Aug 18 '12 at 9:52

Yes (1 or 2 or all) |fdupes -r /home

share|improve this answer

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)
share|improve this answer

I have used fslint and DupeGuru for quite some time.

  • FSlint supports selection by wildcard and other cleanup methods
  • DupeGuru supports regex

Both can handle >10000 files/folders

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.