#!/bin/bash x=1 #change this for jpg or other formats. $1 is the folder where the images are. given as an argument. for fname in $1/*.png do #for more than 999 files change to %04d mv $fname $1/`printf "%04d.png" $x` echo $x x=$(($x+1)) done