How to search and save results to file?

Discussion in 'Apache' started by greatlogix, Mar 15, 2010.

  1. #1
    How can I search my files online using SSH and save results to a text file. I found egrap command but dont know how to save search result to a file.

    Please help
     
    greatlogix, Mar 15, 2010 IP
  2. aroel

    aroel Well-Known Member

    Messages:
    154
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    125
    #2
    sudo find / -name yourfilegoingtobesearched >> result.txt
     
    aroel, Mar 15, 2010 IP
  3. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #3
    It did not work. I got permission denied messages..... :(
     
    greatlogix, Mar 15, 2010 IP
  4. aroel

    aroel Well-Known Member

    Messages:
    154
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    125
    #4
    it means your account is not a sudoer

    which directory you want to search?
     
    aroel, Mar 15, 2010 IP
  5. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #5
    public_html

    Can we do it using grep or egrep command?
     
    greatlogix, Mar 15, 2010 IP
  6. aroel

    aroel Well-Known Member

    Messages:
    154
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    125
    #6
    try

    find /home/your_account/public_html -name yourfilegoingtobesearched >> result.txt

    or

    find /public_html -name yourfilegoingtobesearched >> result.txt
     
    aroel, Mar 15, 2010 IP
  7. greatlogix

    greatlogix Active Member

    Messages:
    664
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    85
    #7
    One correction here. I am searching for a word in all files "Card Type" not the file names. Please suggest correct command. I dont have good experience in linux commands. please help
     
    greatlogix, Mar 15, 2010 IP