GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Search and Replace on a Linux Server (https://gfy.com/showthread.php?t=1086829)

leg4 10-25-2012 01:08 PM

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!!!

Barry-xlovecam 10-25-2012 01:43 PM

Use sed or awk -- Google them for examples.

CYF 10-25-2012 03:59 PM

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?

LBBV 10-25-2012 04:00 PM

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


All times are GMT -7. The time now is 02:13 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123