Hi folks, I'm having a problem with a few of my sites on the same server. I want to search all the files on my server for a url. Is there a tool or command that I can run that will search inside files and not just the file name? Thanks!
You could use something like this: find /dir/ \( -name "*.cgi" -o -name "*.php" \) -print0 | xargs -0 egrep -l 'text1|text2|text3' >> /root/report Code (markup): This looks in the /dir/ directory for cgi and php files, then, scans them for the text1, text2 or text3 phrases, and if a file contains any one of them, it list the file in the /root/report file. Just view the file after the command has finished.
# updatedb -This will update the list of the file you have in your server # locate <filename> -it will list out all the file that have similar name this also including folder.