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
add comment

2 Answers

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
add comment

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

share|improve this answer
add comment

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.