Saturday, March 14, 2015

Finding and deleting duplicate files with fdupes

In a large tree of files, it is common to have duplicate files under different paths. Let's say you want to find them and possibly delete them automatically.
First install fdupes
sudo apt-get install fdupes
Now 'cd' into your directory.
To make a summary of how much space you can save by deleting duplicate files, execute the following:
fdupes -r -m ./
To really delete the duplicate files:
fdupes -r -d -N ./
-N means no prompt (deleting wihout asking anything)
-d means delete
-r means recurse into all subdirectories
without any flag fdupes will print, for each duplicated file, its duplicates, for all files that have duplicates

No comments:

Post a Comment