FSlint can find duplicate files. But suppose one has 10,000 songs or images and wants to find ONLY those files that are identical but have different names? Right now, I get a list that has hundreds of dupes (in different folders). I want the names to be consistent, so I want to see only the identical files with different names, not identical files with the same name.
Can FSlint with advanced parameters (or a different program) accomplish this?
If you're okay that the script prints all duplicate files with both equal and different filenames, you can use this command line:
For an example run, I use the following directory structure. Files with similar name (and different number) have equal content:
And now let's watch our command doing some magic:
Each group separated by a new line consists of files with equal content. Non-duplicate files are not listed.
I have another, far more flexible and easy to use solution for you!
Copy the script below and paste it to
/usr/local/bin/dupe-check
(or any other location and file name, you need root permissions for this one).Make it executable by running this command:
As
/usr/local/bin
is in every user's PATH, everybody may now run it directly without specifying the location.First, you should look at the help page of my script:
You see, to get a list of all files in the current directory (and all subdirectories) with different file names, you need the
-d
flag and any valid combination of formatting options.We still assume the same test environment. Files with similar name (and different number) have equal content:
So we simply run:
And here is the script:
Byte Commander's excellent script worked, but did not give me quite the behavior I needed (listing all duplicate files that include at least one with a different name). I made the following change and now it works perfectly for my purposes (and has saved me a TON of time)! I changed line 160 to:
args.name_filter == "d" and len(filenames[filename]) >= 1 and len(filenames[filename]) != len(hashes[filehash]))