I have two directories: old/ and new/. Some of the files in old/ are duplicates of those in new/. Some merely have the same name, and a few may even have identical content but different names. I'm not interested in the subdirectory path to the files, so only an unqualified filename needs to be considered in the matching.
I want to remove the duplicate files from old/, so that it only contains files not also found in new/. For cases where the filenames match, but not the contents, or vice-versa, I want to have this listed in some log.
Has anyone encountered a similar problem, or have a better solution than hacking together a (perl or similar) script from scratch? A runtime dominated by calling md5sum on each file is acceptable.
