Tuesday, December 28, 2010

SSH Find and Delete

Here's the command you want to use if you want to find every .htaccess file recursively and delete it.

find /path/to/base/dir -name \*.htaccess -exec rm {} \;

I used this command to remove .htaccess files that a spider virus placed throughout my web server. If I didn't use this method the only other way would be to individually go through each folder and delete file that was causing all my hosted websites to redirect to a rogue website.... and that wasn't possible because I host hundreds of websites, each with hundreds of recursive folders.
  • rss
  • Del.icio.us
  • Digg
  • Twitter
  • StumbleUpon
  • Reddit
  • Share this on Technorati
  • Post this to Myspace
  • Share this on Blinklist
  • Submit this to DesignFloat

0 comments:

Post a Comment