Skip to content

Instantly share code, notes, and snippets.

@abhishek77in
Last active December 15, 2015 09:39
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 abhishek77in/5239996 to your computer and use it in GitHub Desktop.
Save abhishek77in/5239996 to your computer and use it in GitHub Desktop.
Directory level search and replace string

Using ack, xargs and sed in shell -

ack -l old_str | xargs sed -i -e "s/old_str/new_str/g"

Example ack -l excerpt | xargs sed -i -e "s/excerpt/description/g"

Using VIM -
Doing this will be quite complicated in vim as explained by Drew Neil in vimcasts.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment