Can't Seem to Remember
Friday, May 05, 2006, at 07:31AM
By Eric Richardson
I always forget how to rename a bunch of files at once, and I always end up having to ask pcg. This time I'm recording it so I remember next time. :
for i in *.jpg ; do j=`basename $i .jpg` ; mv $i $j.gif ; done
Or:
j=`echo $i | sed 's/.jpg/.gif'` ; mv $i $j ; done
Now I know where to look next time I forget.