fdupes - finds duplicate files in a given set of directories
create file1.txt $ cat file1.txt i love linux i love python
create file2.txt with same content as file1.txt $ cat file2.txt i love linux i love python
To find duplicate contents with different file names in the current directory $ fdupes .
To search for duplicates recursively under every directory $ fdupes -r /home
To find the size of duplicates in the current dir $ fdupes -S .
To find duplicates in more than one directory $ fdupes /home/<username>/Downloads /home/<username>/Documents
To display a summary of all information related to duplicate files in the current directory $ fdupes -m .
$ cat filea.txt hello $ cat fileb.txt hello $ cat filec.txt hello
To remove duplicate files in the current directory $ fdupes -d . Set 1 of 1: 1 [ ] ./filea.txt 2 [ ] ./fileb.txt 3 [ ] ./filec.txt
if we want to keep file 2 and delete 1 and 3 ( Preserve files [1 - 3, all, help] )=2 then ( Preserve files [1 - 3, all, help] ): prune and hit ENTER ( No duplicates remaining; type 'exit' to exit program ):exit
To preserve the first instance of a file in every set of duplicate files and want to ignore the prompt $ fdupes -d -N .
To display help options $ fdupes --help
regards, T.Dhanasekar