I need to do a search and replace on my Unix server. I need to find string A in all .php .html files and replace it with string B down through subdirectories too. I am not sure how to do this. Has anyone else had to do this before? Find and grep? Christine
Do you have a local copy of your site? It's very easy to do locally, but there are many programs out there that will do search/replace via ftp
I need to change the files on a Unix server. Thousands of them. I found a free perl script at http://www.zzzgifts.com/script.html. It's doing what I need. Christine
Hi, Make sure you have a backup before you play about with this as an inopportune typo in the command can make a mess of your files. Also, make sure you are in the correct directory when you issue the command! Assuming you have shell access and read/write access to all the applicable files... $ find . \( -name "*.php" -or -name "*.html" \) | xargs grep -l StringA | xargs sed -i -e 's/StringA/StringB/g' Code (markup): Cheers,