Created
October 16, 2012 20:11
-
-
Save kalenjordan/3901671 to your computer and use it in GitHub Desktop.
Find and mass replace, Find and delete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete backup files | |
find . -name "*.bak" -exec rm {} \; | |
# Find and mass replace. It creates .bak files, but without the .bak this doesn't work in OSX | |
find . -exec sed -i.bak s/Find/Replace/g {} \; | |
# find and replace | |
ack -l 'Find' | xargs perl -pi -E 's/Find/Replace/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment