Hantera dubbletter av filer
Going around wondering when the time will come to organize all your duplicated files? My time did come and i decided to spend two hours on finding a program for duplicates. After playing around with a couple of GUI-based programs which was close to perfection i found Fdupes.
A small program written by Adrian Lopez and compares the files with a MD5 signature and I must say that this program really saved time, space and some money for me. The syntax is really easy and I came up with one that suited my needs perfectly.
I wanted to scan through all my backup files in my extended hard drive and localize duplicates and remove all but one. The line is small but powerful and make sure that you run the script from the right location. Here we go:
# fdupes -r -d /media/usb1/
The program will print all the duplicates and for each match you must choice which one to save (on what location rather), in my case that meant 193 032 times. So, I just added “yes 1” which will automatically choice the first one in the list. It may not work for all of you if the catalog structure is important.
# yes 1 | fdupes -r -d /media/usb1/
If you use Debian/Ubuntu like me you can install it easy with aptitude typing:
# apt-get install fdupes