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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-13-2012, 08:26 AM   #1
roly
Confirmed User
 
Join Date: Aug 2002
Posts: 1,844
how to bulk change names in directory of centos server?

hi

i've got a folder with 1000+ text files in it, does anyone know what i can type on the command line (maybe a perl command or something?) to change the name slightly e.g.

old file names: file062012.sitename.net.txt file77582.sitename.net.txt etc

new file names: file062012.www.sitename.net.txt file77582.www.sitename.net.txt

thanks in advance
roly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:30 AM   #2
DamageX
Marketing & Strategy
 
DamageX's Avatar
 
Industry Role:
Join Date: Jun 2001
Location: Former nomad
Posts: 14,293
rm -rf *
__________________
Whitehat is for chumps

If you don't do it, somebody else will - true story!
DamageX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:32 AM   #3
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
rename sitename www.sitename *

or

$ rename 's/sitename/www.sitename/' *
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

Last edited by Colmike9; 09-13-2012 at 08:33 AM..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:32 AM   #4
roly
Confirmed User
 
Join Date: Aug 2002
Posts: 1,844
Quote:
Originally Posted by DamageX View Post
rm -rf *
are you sure, can you test it on your server first?
roly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:36 AM   #5
DamageX
Marketing & Strategy
 
DamageX's Avatar
 
Industry Role:
Join Date: Jun 2001
Location: Former nomad
Posts: 14,293
Quote:
Originally Posted by roly View Post
are you sure, can you test it on your server first?
Done. It's safe, you can go ahead now.
__________________
Whitehat is for chumps

If you don't do it, somebody else will - true story!
DamageX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:41 AM   #6
roly
Confirmed User
 
Join Date: Aug 2002
Posts: 1,844
Quote:
Originally Posted by DamageX View Post
Done. It's safe, you can go ahead now.
didn't work, but as a bonus i have a lot more space on my HD, thanks for your help
roly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:41 AM   #7
roly
Confirmed User
 
Join Date: Aug 2002
Posts: 1,844
Quote:
Originally Posted by Colmike7 View Post
rename sitename www.sitename *

or

$ rename 's/sitename/www.sitename/' *
just having a play with that now, thanks
roly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:41 AM   #8
DamageX
Marketing & Strategy
 
DamageX's Avatar
 
Industry Role:
Join Date: Jun 2001
Location: Former nomad
Posts: 14,293
Quote:
Originally Posted by roly View Post
didn't work, but as a bonus i have a lot more space on my HD, thanks for your help
Happy to help.
__________________
Whitehat is for chumps

If you don't do it, somebody else will - true story!
DamageX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-13-2012, 08:46 AM   #9
Colmike9
(>^_^)b
 
Colmike9's Avatar
 
Industry Role:
Join Date: Dec 2011
Posts: 7,223
Quote:
Originally Posted by roly View Post
just having a play with that now, thanks
Hope it works. I think the first one works just for CentOS 5.5, but I might be wrong. The second is the Debian / Ubuntu perl version of rename. Use YMMV if you're using another distro or OS.
__________________
Join the BEST cam affiliate program on the internet!
I've referred over $1.7mil in spending this past year, you should join in.
I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..
Colmike9 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.