Fdupes is a small and fast utility for finding duplicate files and deleting them.
Install the app:
apt install fdupes
This example is very dangerous, DO NOT try it first, since it will erase all duplicates without asking, and potentially you could loose other files, this is JUST an example:
fdupes -rdN /home/piroman/test
In this example, swith r is for recursive, meaning it will go through all sub directories, d is for actual deletion of files and N is to NOT ask for your choice.
How to use fdupes in more safe way:
fdupes -r /home/piroman/test > /home/piroman/test/fdupes-list.txt
This will create a file: fdupes-list.txt in that file you can check the actual list of found duplicates.
An interactive way of using fdupes will list all duplicates and allow you to make a choice for every group od duplicate files, which one to keep…
fdupes -r /home/piroman/test
This is not a real option if you’re dealing with hundreds or thousands of duplicate files.
The conclusion is that the first example is probably the way to go, but after you’ve checked everything first.
