Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6

    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

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,412
    Code:
    locate httpd.conf |xargs grep "dev.mysite.com"
    But how come, you have so many of them and shouldnt they be in /etc/apache/ ?
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6
    Quote Originally Posted by Irithori View Post
    Code:
    locate httpd.conf |xargs grep "dev.mysite.com"
    But how come, you have so many of them and shouldnt they be in /etc/apache/ ?
    thanks for response

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •