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!

search for files & remove it from the server

Discussion in 'General Discussion' started by crazyaboutlinux, Oct 25, 2011.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    939
    Likes Received:
    0
    Trophy Points:
    66
    Hi,

    i need a command which search for a file "indexxx.php" in the /home/*/public_html/* (directory & its all sub directories) & remove them from the server
     
  2. Chris.Bshm

    Chris.Bshm Member

    Joined:
    Oct 20, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    51
    Hello,

    This for loop should work for you. If 'xx' is a variable, just replace it with an aesteric (*)

    for i in `find /home/*/public_html/ -iname 'indexxx.php'`; do rm -rfv $i; done


    Hope this helps.
     
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