for i in *.*; do j=`echo $i | sed 's/abc_\(.*\)\.jpg/def_\1.jpg/g'`; mv "$i" "$j"; done