Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-17-2009, 03:39 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 7

Rep: Reputation: 1
1000+ Capitalized Directories

Howdy there, I'm rather new to linux but I know how to get around inside the OS, and one of the things I have noticed is that Linux is very CaSe Sensitive, normally this is only a minor inconvenience but I came across a server addon for the BF1942 server that I run that has 1000+ capitalized directories and files, but the server only reads lowercase. It would be impossible to decap them all manually and my searches here and elsewhere led me only to a PHP script at The script works, sort of, but it wont decap files in child directories, or decap directories at all, it only decaps files. I'm sure somebody has come across this problem before and there has got to be a solution other than this single PHP script that only half works. I hope to hear from somebody soon
Old 06-17-2009, 04:06 AM   #2
LQ Newbie
Registered: Jun 2009
Posts: 7

Original Poster
Rep: Reputation: 1
Well now I feel stupid, only 10 min after making this post I found the answers I needed here

root_directory="${1?-please specify parent directory}"
do_it () {
    awk '{ lc= tolower($0); if (lc != $0) print "mv \""  $0 "\" \"" lc "\"" }' | sh
# first the folders
find "$root_directory" -depth -type d | do_it
find "$root_directory" ! -type d | do_it
Load that into a text editor of your choice and save it as then open up a terminal and navigate to the directory you saved it in. Type "bash [directory to be uncapped]" It's as simple as that. I hope this helps anybody else with the same problems


case, directories

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files and sub-directories of a directory except the directories named ".abc" sri1025 Linux - General 2 08-24-2010 09:53 AM
How do I copy over directories to directories with the same name without overwriting? SentralOrigin Linux - General 1 03-14-2009 02:09 AM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 04:22 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 01:23 PM
A 1000 Posts LinuxLala LQ Suggestions & Feedback 8 08-17-2004 11:56 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration