Mass rename files...?

Jasoco

Video Gamer/Collector
Say I have a folder full of files with a .gif extension. How can I rename them all to have a .jpg extension easily?

Thanks.
 
I would use terminal to do this personally. The 'mv' command is great for this:

Type 'man mv' or check out this link for information.

R.
 
here is a script i wrote to kill blanks and remove some naughty chars:
#!/bin/sh
{ for file in *; do \
NEW=`echo $file | sed 's/ /_/g'`;
NEW=`echo $NEW | sed 's/#26E5D//g'`;
NEW=`echo $NEW | sed 's/#26E5E//g'`;
NEW=`echo $NEW | sed 's/#250E9//g'`;
NEW=`echo $NEW | sed 's/#250E8//g'`;
NEW=`echo $NEW | sed 's/#26E60//g'`;
echo "mv -f $file $NEW;"
mv -f "$file" $NEW;
done;
}
 
Try this:
Code:
#!/bin/sh

for filename in *.gif
do
   newfname="`echo $filename | sed 's/.gif/.jpg/'`"
   echo "renaming $filename to $newfname"
   mv $filename $newfname
done

exit 0
There's more we can do with this, but this'll suffice for now, I hope. :)
 
Back
Top