Blog PostChange file names case from upper case to lower case

A friend of mine asked me a good question, he copied files from a Windows Partition to his Linux partition, and some of the files had upper case letters. He wanted to convert all file names to lower case, and they were lots of files, thus he didn't want to change them one by one. He asked me how to do it, and I helped him out. Its a simple line to convert all files from upper case to lowercase

for i in `ls`; do old=$i; new=`echo $i | tr [:upper:] [:lower:]`; mv $old $new; done;

And all files in the same directory are converted to lower case.

Comments

Discuss with me and others You need to sign in to post comments