Skip to content

Instantly share code, notes, and snippets.

@dpwright
Created April 17, 2012 00:57
Show Gist options
  • Save dpwright/2402657 to your computer and use it in GitHub Desktop.
Save dpwright/2402657 to your computer and use it in GitHub Desktop.
Selectively deleting any instance of LINE from files matching SEARCH using ex
grep -Rl "SEARCH" . | while read FILE; do (echo "g/LINE/d"; echo 'wq') | ex -s FILE; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment