How can I grep a file?

Posted on 2005-04-12
Last Modified: 2010-04-20
Simple, but not for me.

How can I find out where a certain file is:  i.e. index.html on my server?

I am using ssh and someone else has already loaded the site to the server, but does not know which folder the website lies.

Is there an easy way to do this?

Question by:foreverdita
    LVL 15

    Accepted Solution

    as root run

    then run
      locate index.html


    find / -xdev -print | grep index.html

    -xdev only looks in the root filesystem but I expect index.html is  under root
    LVL 16

    Expert Comment

    actually, for RedHat the default location for index.html would be in /var/www/html/ so you may not want to use -xdev....

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now