Tuesday, August 20, 2013

Batch rename images to sequence number with script

To get some test images.
Get images from images.baidu.com, as follows,

















create a shell script (.sh) file with following content

n=0
for file in *.jpg; do
    file_name="$n.jpg"
    n=$(( $n+1 ))
    mv $file $file_name
done


Images are renamed to sequence number


No comments:

Post a Comment