Skip to content

Instantly share code, notes, and snippets.

@ggarnier
Last active September 3, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggarnier/0ef03a10a9d8d41232d2 to your computer and use it in GitHub Desktop.
Save ggarnier/0ef03a10a9d8d41232d2 to your computer and use it in GitHub Desktop.
Find/replace in multiple files
oldstring="describe"
newstring="RSpec.describe"
path=path/to/files
grep -rl $oldstring $path/* | xargs sed -i '' s/$oldstring/$newstring/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment