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!

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:
    939
    Likes Received:
    0
    Trophy Points:
    66
    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:
    56
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. madaboutlinux

    madaboutlinux Well-Known Member

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

    find word in the files & search : Hosting Security and Technology : Web Hosting Talk
     
    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