Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

    May 21, 2007
    Likes Received:
    Trophy Points:
    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,
    #1 Stephen Winters, May 21, 2007
    Last edited: May 21, 2007
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Nov 29, 2006
    Likes Received:
    Trophy Points:
    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

    Jan 19, 2004
    Likes Received:
    Trophy Points:
    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
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice