Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find and mass replace, Find and delete
# 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