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.

find word in the files & search

Discussion in 'General Discussion' started by crazyaboutlinux, Feb 4, 2010.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    there are so many files in directory public_html with different ext e.g. .html , .htm , .php & much more.

    now i want to find particular word in all html (*.html)files & get list of that files.

    i have randomly checked 4-5 .html pages , 4-5 .htm pages & 4-5 .php pages & i have found .cn:8080 named virus scripts in those files, there more than 5000 files including .php .htm .html

    I hope you guys understand what i meant to say !

    Thanks!

    Regards,
    Nilesh
     
  2. Kevinfrom

    Kevinfrom Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    From command line you can use the grep command to search thru files.

    man grep

    grep 8080 /home/*/public_html

    or

    find /home/*/public_html -type f |xargs grep 8080

    You can also use other commands (awk, sed) to remove these files or lines from the files.
     
  3. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Your own duplicate thread ;)..

    find word in the files & search : Hosting Security and Technology : Web Hosting Talk
     
Loading...

Share This Page