Skip to content

Instantly share code, notes, and snippets.

@mark-d-holmberg
Created September 29, 2011 19:32
Show Gist options
  • Save mark-d-holmberg/1251692 to your computer and use it in GitHub Desktop.
Save mark-d-holmberg/1251692 to your computer and use it in GitHub Desktop.
How to purge passwords from files
#to find the offenders
find -name "*\.php" -print0 | xargs -0 grep -Rin "password" > results.txt
# to replace it with garbage
find . -name "*.php" -print0 | xargs -0 sed -i -e 's/FINDME/REPLACEWITHME/g'
# you can change '*.php' to the extension you want.
# remove the command from .bash_history
> ~/.bash_history
history -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment