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 Mark Forums Read
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 10-25-2012, 01:08 PM   #1
leg4
Confirmed User
 
Join Date: May 2003
Location: Texas
Posts: 4,429
Search and Replace on a Linux Server

Hey guys,

I have hundreds of links I need to replace across a few different domains/cpanels.

I was wondering if any one knew of an easy way to do this?

Or some script to do it? (Like bk search and replace BUT on the server itself)

Thanks!!!
leg4 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2012, 01:43 PM   #2
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Use sed or awk -- Google them for examples.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2012, 03:59 PM   #3
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
something like this?

find / -name "*.php" -print | xargs sed -i 's/www.example.com/www.newurl.com/g'

what do the urls look like that you're trying to change?
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons


Last edited by CYF; 10-25-2012 at 04:00 PM..
CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2012, 04:00 PM   #4
LBBV
Confirmed User
 
LBBV's Avatar
 
Join Date: Aug 2002
Location: Atlanta
Posts: 936
If you're on Linux, use rpl
Usage: rpl [options] old_string new_string target_file(s)

"man rpl" will give you more options, such as how to do recursive...

Works great for things like this

-- Bill
__________________
National Net Hosting. Handled.
See our new line of inexpensive Dedicated Servers | Cabinets starting at $795 | CDN
[email protected] | 888-4-NATNET | www.nationalnet.com
LBBV 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
Thread Tools



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.