Skip to content

Instantly share code, notes, and snippets.

@kalenjordan
Created October 16, 2012 20:11
Show Gist options
  • Save kalenjordan/3901671 to your computer and use it in GitHub Desktop.
Save kalenjordan/3901671 to your computer and use it in GitHub Desktop.
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