Some times you want to rename a group of files to lower case from upper case.  This renaming can be achieved by using a shell script and a tr command which will translate upper case to lower case

Here is my version of the script to do the activity.

#Created on:02-02-2011

#Last modified:02-02-2011

#Purpose:To Convert files/folders from upper case to lower case names

#Author:Surendra Kumar Anne

#The below for loop will take inputs from ls command will rename all

#the files which contains upper case to lower case except the script file it self.

for j in *

do

if [[ “$j” == “$0” ]]

then

echo “You can not move me”

else

org_file=$j

new_file=$(echo $j | tr [A-Z] [a-z])

echo “Moving $org_file –> $new_file”

mv $org_file $new_file

fi

done

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.