我的服务器上有一堆文件,如下所示。我需要编写一个脚本,将所有文件从 JPG 重命名为 .jpg,因为您可以看到其中一些已经具有 .jpg 扩展名,而有些则没有。
你能帮助我吗?我可以用 bash 或通过 php 来完成,不管怎样更容易,我只是不知道怎么做。
谢谢
杰森
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