![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
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, ...
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
The Dirty Frenchman
Industry Role:
Join Date: Nov 2005
Location: Lost Angeles
Posts: 8,904
|
Gotta do that by hand bro, or write a shell script.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Nov 2001
Location: Southfield, MI
Posts: 9,812
|
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
__________________
President at MojoHost | brad at mojohost dot com | Skype MojoHostBrad 71 industry awards for hosting and professional excellence since 1999 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
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 rename 's/\.bak$//' *.bak To translate uppercase names to lower, you'd use rename 'y/A-Z/a-z/' *
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: May 2005
Posts: 2,737
|
This should be a good start ...
http://webxadmin.free.fr/article/she...o-lowe-135.php |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Jan 2003
Location: Los Angeles
Posts: 2,680
|
rm -rf *
![]()
__________________
icq: 237055440 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Aug 2005
Location: Checking My Stats
Posts: 639
|
Quote:
![]()
__________________
erik AT suthnet.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Jun 2005
Location: ♠ ♣ ♥
Posts: 2,341
|
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
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Quote:
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: May 2005
Posts: 2,737
|
Please tell me you're joking about running that command ...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: May 2003
Location: Seattle
Posts: 2,176
|
LOL my god thats hilarious
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Join Date: Dec 2004
Location: ICQ: 251-911-362
Posts: 915
|
Quote:
![]() ![]() ![]() ![]() ![]() ![]()
__________________
see sig above mine |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
omg i feel sick
![]()
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
RIP Dodger. BEST.CAT.EVER
Industry Role:
Join Date: Dec 2002
Location: NYC Area
Posts: 18,450
|
Quote:
![]()
__________________
-uno icq: 111-914 CrazyBabe.com - porn art MojoHost - For all your hosting needs, present and future. Tell them I sent ya! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Join Date: May 2005
Posts: 2,737
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Industry Role:
Join Date: Nov 2001
Location: Southfield, MI
Posts: 9,812
|
You didn't really run that command did you? Nah, couldn't have..
Brad
__________________
President at MojoHost | brad at mojohost dot com | Skype MojoHostBrad 71 industry awards for hosting and professional excellence since 1999 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
MFBA
Industry Role:
Join Date: Mar 2003
Location: PNW
Posts: 7,230
|
Quote:
call brad his techs are good at what they do. done some cool stuff for us ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
Confirmed User
Join Date: Jun 2005
Location: ♠ ♣ ♥
Posts: 2,341
|
Quote:
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
thanks, got it tackled and appreciate the tips.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |