The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I search content of files on website?

Discussion in 'General Discussion' started by Stephen Winters, May 21, 2007.

  1. Stephen Winters

    Stephen Winters Registered

    Joined:
    May 21, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    On my computer if I want to find all the files that contain a particular word or phrase, I can just do a search for the file content. Is there some way to search the content of all the files on the website to find all files that contain a particular word?

    The reason I want to do this is that over the last few years I have tried out a number of different CMS software (which I manually installed), including setting up the MySQL databases. Consequently, my website has a lot of clutter, including some extra MySQL databases that I don't know which CMS goes with. Now I want to clean up all the clutter out of the files, and to delete the unneeded databases. But before I delete anything I want to identify which database goes with which CMS software. On some of the software, such as Drupal, I know right where to find the settings file that contains the database configuration info. However, on the other CMS's, such as Joomla and Gallery2, I can't find the files that contain the database configuration info (which tells me the name of the MySQL database that is used with that CMS). So I want to do a search through all the files to find which files contain links to the databases. This will help me identify which databases go with which CMS.

    Thanks for your help.

    Best Wishes,
    Stephen
     
    #1 Stephen Winters, May 21, 2007
    Last edited: May 21, 2007
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If your web hosting provider has upgraded to cPanel 11 (most users will notice because they will have a nice neat X3 interface to look at instead of that old X/X2 interface), then you can set up web disk. This will allow you to mount the contents of your web hosting account to your computer as if it was a hard drive then do anything to it as you would a normal hard drive.

    However, there are more creative solutions out there that involve the use of shell commands (but those assume you have shell access) - I'll leave that for the other forum members to address :)
     
  3. visiox

    visiox Well-Known Member

    Joined:
    Jan 19, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    if you have shell access ->

    go to the directory you want to search (e.g. home)
    cd /home
    now let's find the word you are looking for (e.g. "testing")
    grep -R testing *

    that's it
     
Loading...

Share This Page