This is a small script to rename multiple files from CAPITAL to small letters. Ok, why we require to do this? Recently we bought a new cam which is naming all photos in capital and it is very much difficult for me to change extension of these photos from caps to small to re-size/modify photos using mogrify Linux tool.

#!/bin/bash
#Author: Surendra Anne
for j in *
do
COUNT=$(ls -1 | wc -l)
if [ $j == $(basename $0) ]
then
echo “can not move  the script file which is running this”
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

Comment if there is any issue with this script.


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.