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
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018