Skip to content

Instantly share code, notes, and snippets.

@betawax
Created June 16, 2019 10:42
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 betawax/7b8763c10d98dc90e86ddf9b8d37bc96 to your computer and use it in GitHub Desktop.
Save betawax/7b8763c10d98dc90e86ddf9b8d37bc96 to your computer and use it in GitHub Desktop.
Search & Replace in place
sed -i "s/foo/bar/g" foobar.txt
perl -i -pe "s/foo/bar/g" foobar.txt
ruby -pi -e "gsub(/foo/, 'bar')" foobar.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment