How to change all Upper-case filenames to lower-case?

What - I think- SirDice means is to use tr(1) in a script that will list files in your folders (using ls(1)) and change their uppercase letters to their corresponding lowercase ones (using mv(1)).

The listing part is quite easy, you can do it by using the following syntax, for example:

$ for file in `ls /path/to/folder`; do blabla; done
 
Hi lucky7456969,

I wrote a simple script to do this:

Code:
#!/bin/sh

for OLD in $1/* ; do
        NEW=`echo "$OLD" | tr '[A-Z]' '[a-z]'`
        if [ "$OLD" != "$NEW" ] ; then
                mv      "$OLD"  "$NEW"
        fi
done
exit 0

You can use it in this way:
/path/to/script /path/to/dir
 
Back
Top