My server is running linux, recently a lot of our files on our server (.html, .php and .js files) were edited by a hacker, and we want to do a mass search and replace on files with these extensions.
Does anybody know a command I can run in SSH to search and replace files with the extensions .php, .html and .js
Look in: .js, .html, .php
Replace with: ""
Thanks in advance.
You can do this using a combination of [find or [URL="http://unixhelp.ed.ac.uk/CGI/man-cgi?grep"]grep to recurse through directory and [URL="http://unixhelp.ed.ac.uk/CGI/man-cgi?sed"]sed](http://unixhelp.ed.ac.uk/CGI/man-cgi?find) to perform the replacement.
Make sure and test any solution offline before unleashing on a live server as there is the potential to annihilate your server if done wrong!
(you can use vmware player and a linux vmware image if you don't have a test environment to hand)