#!bin/bash
rename ‘y/A-Z/a-z/‘ *.JPG
rename ‘s/photo/photo000/g’ *.jpg
#!/bin/bash
for fn in *.JPG
do
fn_small=${fn,,}
num=${fn_small//[a-z.]}
mv $fn ${fn_small/$num/$(printf "%04d" $num)}
done
for i in $(seq 1 9999); do touch PHOTO$i\.JPG; done
#!/bin/bash
for fname in PHOTO*;
do
number=$(echo $fname | sed -r 's/PHOTO([0-9]+)\.JPG/\1/');
echo $fname - $number;
case $number in
?)
newname='photo000'$number.jpg
;;
??)
newname='photo00'$number.jpg
;;
???)
newname='photo0'$number.jpg
;;
????)
newname='photo'$number.jpg
;;
esac
echo "old: $fname new: $newname";
# mv $fname $newname
done