Skip to content

Instantly share code, notes, and snippets.

@felixebert
Created August 20, 2015 14:20
Show Gist options
  • Save felixebert/dd3011b8e702a5879507 to your computer and use it in GitHub Desktop.
Save felixebert/dd3011b8e702a5879507 to your computer and use it in GitHub Desktop.
delete files using find + checksum - e.g. for hacked wordpress sites
#!/bin/sh
files=$(find . -name ".htaccess")
for file in $files; do
md5=`md5sum ${file} | awk '{ print $1 }'`
if [ "aaecfaf864b713ea1b05151222649929" = "$md5" ]; then
rm -f $file
else
echo $file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment