image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old September 30th, 2002, 02:01 AM
Jasoco's Avatar
Video Gamer/Collector
 
Join Date: Jun 2001
Location: Doylestown PA
Posts: 499
Jasoco is on a distinguished road
Mass rename files...?

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.
__________________
Confucious Say: Jasoco, change your gosh darn SIGNATURE! it's been like that forever!
Never disobey Confucious.

Jasoco.net - GeekPub Forums
Reply With Quote
  #2  
Old September 30th, 2002, 03:08 AM
roger's Avatar
Registered User
 
Join Date: May 2001
Location: UK
Posts: 356
roger is on a distinguished road
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.
__________________
iBook SE Graphite OSX
iMac DV+ OSX
Airport Base Station
20GB iPod
Bluetooth and t68i
Reply With Quote
  #3  
Old September 30th, 2002, 04:11 AM
couzteau's Avatar
Registered User
 
Join Date: Nov 2001
Location: germany
Posts: 102
couzteau is on a distinguished road
here is a script i wrote to kill blanks and remove some naughty chars:
Quote:
#!/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;
}
Reply With Quote
  #4  
Old September 30th, 2002, 11:52 PM
Writer, et. al.
 
Join Date: Aug 2002
Location: Boulder, CO
Posts: 47
d1taylor is on a distinguished road
Smile try this script

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. :-)
__________________
Author, Learning Unix for Mac OS X (O'Reilly), among other books.
Check out http://books.intuitive.com/
Reply With Quote
  #5  
Old May 8th, 2008, 04:01 AM
Registered User
 
Join Date: May 2008
Posts: 3
cekim is on a distinguished road
Have you tried Renamer4Mac to batch rename your files?
Reply With Quote
  #6  
Old May 8th, 2008, 01:46 PM
Registered User
 
Join Date: Mar 2005
Posts: 179
artov is on a distinguished road
for i in *.gif; do
mv $i `basename $i .gif`.jpg
done
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
moving my itunes files to another location Numbers1820 Mac OS X System & Mac Software 2 December 20th, 2002 10:02 PM
Photoshop Q: mass changes to multiple files? themacko Design & Media 4 December 4th, 2002 11:01 PM
Native FTP program? bighairydog Apple News, Rumors & Discussion 17 November 30th, 2001 02:31 PM
Solution: OS X creating "." files on Samba shares dricci Apple News, Rumors & Discussion 0 November 21st, 2001 11:23 PM
Editing plain old text files Allan Crowson Mac OS X System & Mac Software 6 December 4th, 2000 11:19 AM


All times are GMT -5. The time now is 11:48 AM.


Mac Support® Version 3.7.0 Beta 5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.