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 to find a line of code

Discussion in 'General Discussion' started by PeterSauer, Jan 7, 2015.

  1. PeterSauer

    PeterSauer Registered

    Joined:
    Jan 9, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I had written a line of code in a file redirecting my blog to my website and I can't find it, I have looked in all the htaccess files and there are no rewrites or redirects in them, is there a way to search the whole cpanel site for this, as I seem to recall I made some changes to a php file
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,855
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you have SSH access to the account? If so, you could use the "grep" command. EX:

    Code:
    grep $search-term /home/$username/public_html/file.php
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. PeterSauer

    PeterSauer Registered

    Joined:
    Jan 9, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I have SSH/Shell Access.
    It shows me "Manage SSH keys
    Can you tell me how I use the code you gave me? Do I create a new key, in the "Generate a new key" field?
    Many Thanks
    Peter
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,855
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Are you sure a key is required? Simply enter your account username/password via a SSH client (e.g. Putty) and use the referenced command. Note that if you have no experience with SSH then it might be a better idea to consult with a system administrator or your hosting provider for assistance. This document should help you get connected:

    Accessing your server via SSH

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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