Skip to content

Instantly share code, notes, and snippets.

@blakesmith
Created April 24, 2012 15:46
Show Gist options
  • Save blakesmith/2480878 to your computer and use it in GitHub Desktop.
Save blakesmith/2480878 to your computer and use it in GitHub Desktop.
Rails global find/replace
export search="Find string"
export replace="Replace string"
grep -l -R $search app spec lib | xargs sed -i -e "s/$search/$replace/g"
find . -name "*-e" | xargs rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment