MacOS – How to find duplicate folder names and resolve naming conflicts in OS X

foldersitunesmacosnasrename

I have my music collect on my NAS and would like to copy it to my laptop. When I try to copy the music folder and paste it to a new location on my laptop I get messages that OS X can't paste the folder to the new location because a folder with the same name already exists.

For example, let's say I have the following two folders:

/Music/311/horrible album

/Music/311/Horrible Album

As it stands right now, both folders are sitting on my NAS. When I try to copy the Music folder over to my laptop, I get a message that OS X won't allow this because of the above folders have the same name.

Each time I try this whole copy/paste thing I'm getting the same error message, find the conflict, move the files from one folder to the other, delete the original folder and then try again only to have another conflict.

So…I'm trying to find an application or script that could scan my iTunes music folder and see where I have these conflicts so I can actively go in and fix them so that the copy/paste thing will work without errors. I'm a bit of a newbie with Terminal but willing to give it a try.

System specs:

Latest OSX 10.10.4
Lastest iTunes 12.2.1.16
Old Macbook Pro
Synology DS213J

Best Answer

You can do this in bash to identify which files and folders are problematic:

find /path/to/remote/library | tr A-Z a-z | sort | uniq -d

This will output all lower case files and folders that have a duplicate with upper case letters.