Saturday 10 December 2011

search for string within a file under all directories from root

search for string within a file under all directories from root

Hey all,

I'm on ubuntu and using apache web server. Problem is when I run "locate httpd.conf", a ton of files come up. But I only want the conf file that contains the string "dev.site.com" So from the root I try running this:

grep dev.mysite.com httpd.conf

and it says no file httpd.conf and thats because there is no file in the immediate root directory called that. How can I search all directories from root for that file which contains the string specified.

thanks for response

No comments:

Post a Comment