simcon Posted November 7, 2003 Report Share Posted November 7, 2003 Hi, Is there a lowercase console command? I have just copied 1000s of files across from a DVD and all the filenames are uppercase and I want them lowercase. Cheers. Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted November 7, 2003 Report Share Posted November 7, 2003 you are looking for the tr command. the man page should be provide enough info about its usage. i would do it but i am not on a *nix system at the moment but its something like echo "STRING" | tr '[A-Z]' '[a-z]' :) ciao! Quote Link to comment Share on other sites More sharing options...
simcon Posted November 7, 2003 Author Report Share Posted November 7, 2003 Thanks ramfree17 :) I made a function and placed it into my .bashrc file so it's always available:- tolower () { echo "Convert all filenames within this folder to lowercase? [yes|no]"; read yn; if test "$yn" = yes; then for file in *; do mv -v -i $file $(echo $file | tr '[A-Z]' '[a-z]'); done; fi } I've tested it with a few files in a folder, some duplicate but different case and it works fine. Will prompt on overwrites. Cheers. Quote Link to comment Share on other sites More sharing options...
DOlson Posted November 8, 2003 Report Share Posted November 8, 2003 That might be a cool thing to put in the tips section of the board. Just my opinion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.