| View previous topic :: View next topic |
| Author |
Message |
heiowge LXF regular

Joined: Wed Feb 27, 2008 8:21 pm Posts: 1795 Location: Cheshire, UK
|
Posted: Thu May 24, 2012 10:33 pm Post subject: bulk rename |
|
|
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 |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Thu May 24, 2012 11:09 pm Post subject: |
|
|
| 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 |
|
 |
MartyBartfast LXF regular

Joined: Mon Aug 22, 2005 8:25 am Posts: 780 Location: Hants, UK
|
Posted: Thu May 24, 2012 11:10 pm Post subject: |
|
|
for x in `find . -type f ` ; do mv -v ${x} ${x}.jpg ; done _________________ I have been touched by his noodly appendage. |
|
| Back to top |
|
 |
johnhudson LXF regular
Joined: Wed Aug 03, 2005 2:37 pm Posts: 767
|
Posted: Thu May 24, 2012 11:14 pm Post subject: |
|
|
| 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 |
|
 |
heiowge LXF regular

Joined: Wed Feb 27, 2008 8:21 pm Posts: 1795 Location: Cheshire, UK
|
Posted: Thu May 24, 2012 11:21 pm Post subject: |
|
|
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!"
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 |
|
 |
ajgreeny LXF regular
Joined: Wed May 10, 2006 9:18 pm Posts: 407 Location: Oxfordshire.
|
Posted: Thu May 24, 2012 11:24 pm Post subject: |
|
|
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 |
|
 |
roseway LXF regular
Joined: Thu Jan 18, 2007 2:27 pm Posts: 402
|
Posted: Fri May 25, 2012 8:03 am Post subject: |
|
|
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 previous topic :: View next topic |
|