I have two directories, I want to know which files in the second directory also appear in the first and delete the duplicate in the second directory. Filenames might be different (so that rules out diff).
My problem is that various programs (such as fdupes and freedup) are very capable of finding duplicate files but randomly delete (or link) files from the first or the second directory.
Here an example with fdupes:
Code:
[user@pc ~]$ fdupes -rdN /dir1/ /dir2/
[+] /dir2/Geluidsclip 03.wav
[-] /dir1/Geluidsclip 03.wav
[+] /dir2/Geluidsclip 04.wav
[-] /dir1/Geluidsclip 04.wav
[+] /dir1/Geluidsclip 07.wav
[-] /dir2/Geluidsclip 07.wav
As you can see, the file in the third pair is removed from dir1 instead of from dir2. My aim is to have only files deleted from the dir1. I know that fdupes can't do this, as I emailed with the author.