Now that we know how to find a string in a list of files in the home directory, we may also want to replace the string with something else..
Eg: Replacing a password in all the files as and when it is getting changed.
The command to do this is:
find . -type f -name "*.c" -print | xargs perl -i -pe 's/MYOLDPASSWORD/MYNEWPASSWORD/g'
Wednesday, July 21, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment