I have a bunch of files on my server that look like below. I need to write a script that will rename all the files from JPG to .jpg as you can see some of them already have the .jpg extension and some don't.
Can you help me? I could do it in either bash or through php, whatever is easier, I just don't know how.
Thanks
Jason
jects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4742JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4749JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4806JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4726JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4716JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/AGSM-Ground-Floor-2010-036JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4728JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4736JPG.jpg
media/projects/Education/UNSW-AGSM-Ground-Floor-Thr/DSC4724JPG.jpg
media/projects/Education/St_Gregorys_School/IMG0100JPG
media/projects/Education/St_Gregorys_School/IMG0099JPG
media/projects/Education/St_Gregorys_School/IMG0092JPG
media/projects/Education/St_Gregorys_School/IMG0090JPG
media/projects/Education/St_Gregorys_School/IMG0084JPG
media/projects/Education/St_Gregorys_School/IMG0093JPG
media/projects/Education/St_Gregorys_School/IMG0097JPG
media/projects/Education/St_Gregorys_School/IMG0098JPG
media/projects/Education/St_Gregorys_School/IMG0085JPG
media/projects/Education/St_Gregorys_School/IMG0091JPG
media/projects/Education/St_Gregorys_School/IMG0094JPG
media/projects/Education/St_Gregorys_School/IMG0088JPG
media/projects/Education/St_Gregorys_School/IMG0087JPG
media/projects/Education/St_Gregorys_School/IMG0095JPG
media/projects/Education/St_Gregorys_School/IMG0096JPG
media/projects/Education/St_Gregorys_School/IMG0089JPG
media/projects/Education/St_Gregorys_School/IMG0086JPG