Created
June 4, 2014 09:04
-
-
Save compor/8cdb1698795e8d4cb01a to your computer and use it in GitHub Desktop.
convert all file names in the current directory to lower case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# convert all file names in the current directory to lower case | |
# only operates on plain files--does not change the name of directories | |
# will ask for verification before overwriting an existing file | |
for x in `ls` | |
do | |
if [ ! -f $x ]; then | |
continue | |
fi | |
lc=`echo $x | tr '[A-Z]' '[a-z]'` | |
if [ $lc != $x ]; then | |
mv -i $x $lc | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment