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
Old Macbook Pro
Synology DS213J


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.

  • find /path/to/remote/library | sort -f | uniq -i -d will avoid the name-mangling (so you'll keep the original capitalization). If you have access to GNU uniq, you can also use its -D option rather than the -d option to get all of the filenames, rather than just one of them. – R.M. Jan 12 '18 at 19:55

a very unix answer by madmax1 - he is suggesting that you force all file names to lower case on your source disk, then copy .. but his command will fail if both files are in the same folder .. if in different folders on the source disc, no problem. But then, if you copy both files from diff folders on the NAS to the same folder on the destination disk the second one to be copied will overwrite the first one. Maybe not what you wanted.

You could look at the CPIO command .. or the -cpio argument for the "find" command for the filename handling options .. you can copy and rename in one blow as it were .. but this are command line options.

** My first try at an answer missed the point I think .. your problem is not duplicates, it is mixed case filenames. This happens when the file system you are trying to copy the files to does not understand upper/lower-case file names.

You can check this in Disk Utility .. if your destination disk/partition is

Format : Mac OS Extended Journaled

then it cannot handle mixed case names. If it says

Format : Mac OS Extended (Case-sensitive, Journaled)

then it can. You can use Disk Utility to reformat the partition to add case sensitivity, which will erase everything on it so .. careful!

Another way to attack this is get a really good renaming program to process the filenames on the source disk to be unique and acceptable to the destiation disk's formatting. I like .. i mean REALLY LIKE .. "A Better Finder Rename" .. an awsum GUI solution to text processing batches of filenames in all ways.

** now back to the original answer **

There are a few good duplicate file detectors with GU Interface out there. I like Jaikoz for music files myself .. it is a full service music catalog with duplicate resolution and name correction .. so serious overkill for your needs probably, and you have to pay for it.

I also have Gemini from the people that make CleanMyMac .. both helpful programs IMHO.

googling for

mac os x duplicate file detector

or searching for "duplicate" in the app store will provide you many alternatives

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .