How to modify the image name in batches under Linux

  

We all know that it is easy to modify the name of the image under the folder, but it is a waste of time to modify it in batches. So, is there any way to quickly modify the image name in batches? The following small series will introduce you to the method of quickly changing the name of the image under Linux.

10.11 as a number of such directories, etc. 10.11 10.12

then inside the picture .jpg .jpg files to be modified to correspond to the date, that program 1011.jpg An example of such a file name

is as follows:

The code is as follows:

#! /bin/bash

for filename in `ls`

do

echo $filename

cd $filename

file1=$ {filename%%.*}

file2=${filename##*.}

mv *.jpg $file1$file2.jpg

cd . .

done

The above is a quick introduction to the method of manually modifying the image name under Linux. This code can be used to batch modify the image name. If you need to modify the image file name in batches, you may wish to Try this method.

Copyright © Windows knowledge All Rights Reserved