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 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:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    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.
     
  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:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    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.
     
Loading...

Share This Page