![]() |
![]() |
![]() |
||||
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 |
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!!! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
Use sed or awk -- Google them for examples. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Coupon Guru
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |