Skip to content

Instantly share code, notes, and snippets.

@ggarnier
Last active September 3, 2015 18:28
Show Gist options
  • 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