How to rename a long list of photo filenames?

Josef Lowder joe at actionline.com
Tue Nov 8 18:25:41 MST 2005


I have hundreds of photo files that I would like to rename 
to shorter names.  In the past, I have made a shell script 
to do this for some of these, but I'm sure there must be a 
better/easier way to do it than the way I've been doing it. 

Also, I'd like to be able to globally make thumbnails of 
each photo with the same name but with an added letter "t" 
preceding the .jpg 

What is the best way to accomplish both tasks? 

As an example, I have about 25 each of photos 
represented by the first 3 sets listed below ... 

        292459 Oct 29 19:57 pict0001.jpg
        290170 Oct 29 19:59 pict0002.jpg
        291009 Oct 29 19:59 pict0003.jpg

       1946853 Nov  8 15:42 02800001.jpg
       2016255 Nov  8 15:42 02800002.jpg
       2014611 Nov  8 15:42 02800003.jpg

       2224887 Nov  8 15:43 02810001.jpg
       2370735 Nov  8 15:43 02810002.jpg
       2369898 Nov  8 15:43 02810003.jpg

I've been making a shell script like this to rename them, 
but even doing this in a text editor, editing one line at a time, 
gets tedious: 

mv pict0001.jpg a001.jpg 
mv pict0002.jpg a002.jpg 
mv pict0003.jpg a003.jpg 

mv 02800001.jpg b001.jpg 
mv 02800002.jpg b002.jpg 
mv 02800003.jpg b003.jpg 

mv 02810001.jpg c001.jpg 
mv 02810002.jpg c002.jpg 
mv 02810003.jpg c003.jpg 

Any suggestions to simplify this? 



More information about the PLUG-discuss mailing list