[mdlug] batch name changes

Mike Mikowski z_mikowski at yahoo.com
Fri Jan 25 08:24:40 EST 2013


Hi Gary:

1. #Open up a terminal
2. cd <directory with files>
3. pwd # to ensure you are in the right directory
4. # copy and paste
 find ./ -type d |while read dir; do rename 's/$/.jpg/' $(find $dir -type f -maxdepth 1); done
5. # bask in success

Notice this handles all subdirectories as well!

Sent from my ASUS Eee Pad

Garry Stahl <tesral at wowway.com> wrote:

>On 01/24/2013 02:48 PM, Michael Mikowski wrote:
>> Hi Gary:
>>
>> Also, if you need to rename all files and know the extension you want, it is a one-liner (and this should be quite efficient):
>>
>> find ./ -type d |while read dir; do rename 's/$/.jpg/' $(find $dir -type f -maxdepth 1); done
>>
>
>????
>
>How do I use that?  I am not a command line user Linux style.  I barely 
>remember DOS and not well.  Haven't used since the 90s.
>
>Time to break out the Amiga.
>
>
>-- 
>Garry  AKA  --Phoenix--  Rising above the Flames.
>
>I have as much authority as the Pope, I just don't have as many people who believe it.
>Star Trek mort. Viva la Star Trek admiraetur
>The Olde Phoenix Inn http://phoenixinn.iwarp.com
>Metro Detroit Linux Users Group http://www.mdlug.org
>
>_______________________________________________
>mdlug mailing list
>mdlug at mdlug.org
>http://mdlug.org/mailman/listinfo/mdlug


More information about the mdlug mailing list