Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bulk rename

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
heiowge
LXF regular


Joined: Wed Feb 27, 2008 8:21 pm
Posts: 1795
Location: Cheshire, UK

PostPosted: Thu May 24, 2012 10:33 pm    Post subject: bulk rename Reply with quote

My daft wife who is used to the idiot friendly method of not letting you play with the file extensions in windows has renamed all her pictures... without the .jpg extension. There are hundreds of them. She's been using my daughter's mint 11 laptop while hers is in for repair and thinks it's linux being stupid. She doesn't like it when I tell her it's her that renamed them!

Any really easy way of renaming them all to add the .jpg without having to rename every bloody one?

Ta.
_________________
AMD PHENOM II X6, 14 GB DDR3, 500 GB hd, 1GB nVidia card, running Linux Mint 14 KDE / Win 7. Damn thing keeps breaking.

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd running Mint 14 MATE. Running great.
Back to top
View user's profile Send private message
nelz
Moderator


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8002
Location: Warrington, UK

PostPosted: Thu May 24, 2012 11:09 pm    Post subject: Reply with quote

Code:
cd photodir
find -type f ! -iname \*.jpg -exec mv "{}" "{}.jpg" \;


You can also use mmv or the replacement rename from http://rename.berlios.de or Krename.
_________________
Unix is user-friendly. It's just very selective about who it's friends are.
Back to top
View user's profile Send private message
MartyBartfast
LXF regular


Joined: Mon Aug 22, 2005 8:25 am
Posts: 780
Location: Hants, UK

PostPosted: Thu May 24, 2012 11:10 pm    Post subject: Reply with quote

for x in `find . -type f ` ; do mv -v ${x} ${x}.jpg ; done
_________________
I have been touched by his noodly appendage.
Back to top
View user's profile Send private message
johnhudson
LXF regular


Joined: Wed Aug 03, 2005 2:37 pm
Posts: 767

PostPosted: Thu May 24, 2012 11:14 pm    Post subject: Reply with quote

As they are all images, you may be able to use convert (part of the ImageMagick suite) in batch mode to 'convert' them all back to jpg. This would make a second copy of each; so check ImageMagick's command line options.
Back to top
View user's profile Send private message
heiowge
LXF regular


Joined: Wed Feb 27, 2008 8:21 pm
Posts: 1795
Location: Cheshire, UK

PostPosted: Thu May 24, 2012 11:21 pm    Post subject: Reply with quote

Thanks guys. I heard you all give me advice. Then I copied a few pics to a test folder and tried it out. It worked great. Then I turned to my wife and told her and she said those immortal words...

"I've done it now!" Rolling Eyes

Sometimes I don't know why we bother...

Anyway, thanks. I'll keep that tool in my arsenal for next time!
_________________
AMD PHENOM II X6, 14 GB DDR3, 500 GB hd, 1GB nVidia card, running Linux Mint 14 KDE / Win 7. Damn thing keeps breaking.

eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd running Mint 14 MATE. Running great.
Back to top
View user's profile Send private message
ajgreeny
LXF regular


Joined: Wed May 10, 2006 9:18 pm
Posts: 407
Location: Oxfordshire.

PostPosted: Thu May 24, 2012 11:24 pm    Post subject: Reply with quote

If this is a gnome system and you want/need a GUI, you can install gprename from the repos to rename the files. If not gnome there are many other apps available for that purpose. Do a search in synaptic (name only) for them.
_________________
Ubuntu 10.04 user, and loving it!
Back to top
View user's profile Send private message
roseway
LXF regular


Joined: Thu Jan 18, 2007 2:27 pm
Posts: 402

PostPosted: Fri May 25, 2012 8:03 am    Post subject: Reply with quote

The file manager Thunar has a simple and effective bulk rename capability, if you prefer to do this sort of job in a GUI.
_________________
Eric
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast