Skip to content

Instantly share code, notes, and snippets.

@sankars
Created April 11, 2014 16:46
Show Gist options
  • Select an option

  • Save sankars/10483390 to your computer and use it in GitHub Desktop.

Select an option

Save sankars/10483390 to your computer and use it in GitHub Desktop.
# http://stackoverflow.com/questions/471183/linux-command-line-global-search-and-replace
# not recursive. input the file name
sed -i 's/foo/bar/g' *
# recursive
find -name '*.html' -print -exec sed -i.bak 's/foo/bar/g' {} \;
## http://stackoverflow.com/questions/16956810/finding-all-files-containing-a-text-string-in-linux
grep -Rl "CR1" /appl ## R-recursive l-filename
grep -Rnw /appl -e 'CR1' ## n-line number w-word
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment