Today I was about to format my computer, but first I had to backup my files. So I dragged my home folder over to an external hard drive. Turns out the external drive was formatted as case-insensitive and my internal drive is case-sensitive (the true UNIX way). Anyway, the transfer failed because many of my files had the same name, just different case. I freaked out and thought that this would be impossible to fix. But then I remembered that I was a programmer, so I quickly wrote a couple ruby scripts to quickly find files with conflicting names.
I thought some of you might find these useful, so I’m posting them here:

Code
Usage
./casechecker_recursive.rb /path/to/directory
PS
Never format your Mac as case-sensitive, you’ll have major compatibility issues. Trust me.








June 5th, 2009 at 9:49 am
Or, in a more true unix way:
$ find . | tr ‘[A-Z]‘ ‘[a-z]‘ | sort | uniq -d
There’s probably a better way to do case folding, but you get the point.