Skip to content

Instantly share code, notes, and snippets.

@ttamnedlog
Forked from kates/search_and_replace.sh
Last active April 7, 2018 21:15
Show Gist options
  • Save ttamnedlog/a5edb6ddc4e7adcefc295a0256941870 to your computer and use it in GitHub Desktop.
Save ttamnedlog/a5edb6ddc4e7adcefc295a0256941870 to your computer and use it in GitHub Desktop.
bulk search and replace with the silver searcher, awk, sed and xargs
ag $1 --files-with-matches | xargs -I {} sed -i '.back' -e "s/$1/$2/g" {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment