Comparing files within a folder

Solution 1:

fdupes may be your solution. It can be installed via homebrew with

brew install fdupes

If you don’t have homebrew, you can install homebrew with

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Running fdupes -r <directory> will list duplicate files within the directory, even if they’re not in the same folder. fdupes compares based on file contents, not names, so the names being different will not be a problem.

You can use the -d option to be prompted which files to keep (deleting all others), but I would suggest doing the deletions manually.