So, I have the following structure:
. .. a.png b.png c.png
I ran a command to resize them
ls | xargs -I xx convert xx -res
find ./xx -name "*.png" -print0 |sed 's/.png$//g'|xargs -0 -I% mv %.png %.jpg
I like to use following command
find ./xx -name "*.png" -type f|while read FILE; do mv "$FILE" "$(echo $FILE|sed -e 's/.png$/.jpg/')"; done