That worked but appended the word new to all the files, IE
newback.png, newadd.png, etc
I just want to leave the original link name in tact
back.png add.png
That worked but appended the word new to all the files, IE
newback.png, newadd.png, etc
I just want to leave the original link name in tact
back.png add.png
Sorry, there was an error in my earlier command, which I've now fixed. The correct command is:
BTW, if you now have a bunch of files that begin with new, you can remove new with the following command:Code:rename -v 's/^Link to //' *
The -n option in the above command directs rename to do a dry-run and report proposed changes. Then, if all appears well, substitute -v for -n to actually rename the files.Code:rename -n 's/^new//' *
Last edited by kaibob; April 27th, 2009 at 01:12 AM.
Thanks for your help. I will be able to add 5 sets to my icon theme and only require 1 hard set of png files and save massive space.
I shared the frustration DeMus felt with the Rename examples she quoted in her post of February 21 and wished instead for some base instruction Formats. Either that page didn't have them or I glossed over the page too fast. Anyway, I was happy to see mb_Webguy's suggestion - to use instead GPRename, at least to start. I did and, although it also lacks a manual, found the main page to be extremely intuitive and able to satisfy any renaming need I might have in the near future. Thanks, DeMus, for bringing this up and thanks, mb_Webguy for taking the time to make the suggestion (and, of course Tristesse, et al, for writing it)!
Regards,
Fred
Speaking of fun with perl... I have a hundred photos that I want to add "-thumb" on the end of the filename before the extension. Can anyone steer me in the right direction as to how I would do that with a bash command?
e.g.
photo1.jpg needs to be photo1-thumb.jpg
I would like to batch rename all the files in a folder at once.
Thank you for any help. My perl is not so good.
In POSIX shells:
(See http://mywiki.wooledge.org/BashFAQ/073)Code:for f in *.jpg; do mv -iv "$f" "${f%.jpg}-thumb.jpg"; done
Or with prename:
Code:prename -n 's/\.jpg/-thumb.jpg/' *.jpg
Hi Geirha,
Thank you for the help.
- Phil
I just want to say that my script works just as well in Ubuntu 12.10 as it did in previous versions of Ubuntu. Saves me tons of time when importing photos from the camera. I lost the script when I reinstalled Ubuntu, thankfully I had posted it here on the forum so I could just follow my own instructions!
Bookmarks