shell batch modify file suffix

shell batch modify file name

Change the uppercase JPG under test to lowercase JPG
for i in `ls test/*.JPG`;
    do
        mv $i `echo ${i/%JPG/jpg}`;
done;

//or
Change the uppercase JPG under test to lowercase JPG
for i in `ls test/*.JPG`;
    do
        mv $f `echo ${i%JPG}.jpg`;
done;

 

Change the uppercase JPG under test to lowercase JPG
rename The part to be modified is modified into the string modification target
rename .JPG .jpg test/*.JPG

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326710928&siteId=291194637