![]() |
Shell batch rename command/script
I'm hoping someone can help me figure out how to batch rename files recursively thru a directory on our server......ie I'd like to rename all files starting with "thumb_" to "tn_" leaving the remainder of the file name intact so that thumb_pic01.jpg would be renamed tn_pic01.jpg
Any help is greatly appreciated :) |
find . -name "thumb_*.jpg" -exec echo "mv '{}' '{}'" \; | sed 's/thumb_/tn_/2' | /bin/sh
|
Nice one swedeguy Thanks alot! |thumb
|
Also MMV is a very nice tool for the shell which can not rename only, you also can move files, folders etc.
|
Quote:
You're genius! I wish I knew this earlier! |
All times are GMT -4. The time now is 09:11 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc