Finding file-names that differ only by case under Unix
On occasion it is necessary to export a project to a file system that is not case sensitive.
In this situation if you export using SVN, the entire export (which, if from a remote server and on a large project, can often take hours) will halt and produce an error. The error will let you know which file(s) had the matching name, and the official advice is use the command "SVN mv" to rename the file, and try again.
Though this basic approach works, it's much more practical to find _all_ of the names that differ only by case first, fix them, and then run the export. The best way I have found to search for names that differ only by case is to go to the root directory of your project and run the following command:
find . | tr '[:upper:]' '[:lower:]' | sort | uniq -cd
Let's break that down for a little enlightenment:
"find ." invokes the find command, telling it to start in the current directory, and find _everything_, printing it out as a full path.
"|" called a "pipe" is a way of telling Unix (bash actually) to send the output of one command to the command that follows.
"tr '[:upper:]' '[:lower:]'" translates all of the upper case characters to lower case ones.
"sort", not so shockingly sorts the lines alphabetically and is necessary for the next command to work.
Recent posts
- Congratulations To GLEAM On Their Award!
- Extending Personal Campaign Pages
- Switchback is hiring!
- Congratulations to the University of Michigan’s Open Courseware Initiative!
- Basics of Drupal Quickbooks Integration
- Using your own fonts with @font-face in Drupal Gardens
- Drupal 7 is here! Commence Rejoicing!
- We're proud to be part of the Open.Michigan project
- AdaptiveTheme with a Sticky Footer and Skinr Styles
- Ann Arborists and Drupalists!
Caravan is a powerful and full-featured membership management system, designed specifically for membership- driven organizations.
Trailhead is a Drupal-based system, built with the features smaller businesses need, bundled together into a ready-to-launch package.
Our Work
On the Trail Blog
-
We are thrilled to share that one of our...
-
Steve was recently invited to write a...
-
We have some really exciting projects in...