LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-17-2009, 02:39 AM   #1
Xerxes1121
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 http://webscripts.softpedia.com/scri...ile-39210.html 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, 03:06 AM   #2
Xerxes1121
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 http://stackoverflow.com/questions/1...rcase-on-linux

Code:
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 uncap.sh then open up a terminal and navigate to the directory you saved it in. Type "bash uncap.sh [directory to be uncapped]" It's as simple as that. I hope this helps anybody else with the same problems
 
  


Reply

Tags
case, directories



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 08:53 AM
How do I copy over directories to directories with the same name without overwriting? SentralOrigin Linux - General 1 03-14-2009 01:09 AM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
A 1000 Posts LinuxLala LQ Suggestions & Feedback 8 08-17-2004 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:14 PM.

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