![]() |
linux shell gurus, need a command
I have directories:
- one/ - two/ - three/ each directory has images; aaa.jpg, aab.jpg, aac.jpg, etc.. i need to rename them so that I end up with: one/one-aaa.jpg, one/one-aab.jpg, ... two/two-aaa.jpg, two/two-aab.jpg, ... three/three-aaa.jpg, three/three-aab.jpg, ... |
Gotta do that by hand bro, or write a shell script.
|
One of my techs says he can write you a script to do this very quickly if that is what you are asking for. We're happy to help, call 866-746-3674 and ask for Will.
Cheers, Brad |
The command 'rename' is on the server, but I'm not sure how to write the regexp in this format to get the job done.
Code:
For example, to rename all files matching "*.bak" to strip the extension, you might say |
This should be a good start ...
http://webxadmin.free.fr/article/she...o-lowe-135.php |
rm -rf * :winkwink:
|
Quote:
|
cd one/
for i in `ls`; do mv $i one-$i; done cd two/ for i in `ls`; do mv $i two-$i; done cd three/ for i in `ls`; do mv $i three-$i; done |
Quote:
|
Please tell me you're joking about running that command ...
|
LOL my god thats hilarious
|
Quote:
:error :error :error :error :error :error |
omg i feel sick :(
|
Quote:
|
first thing you need to do anytime you take advice from a forum like this or even write a script to do potentially destructive things on your filesystem is to backup everything first!!!!!!!!!!!!!!
cp -r images_directory/ backup_images_directory/ Then experiment with it all you want. Look on the brightside.. at least he didnt tell you to 'rm -rf /'. Then youd really be in trouble. |
Quote:
|
You didn't really run that command did you? Nah, couldn't have..
Brad |
Quote:
call brad his techs are good at what they do. done some cool stuff for us :) |
Quote:
|
thanks, got it tackled and appreciate the tips.
|
All times are GMT -7. The time now is 02:32 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123