Skip to content

Instantly share code, notes, and snippets.

@serpent403
Last active January 1, 2016 23:29
Show Gist options
  • Save serpent403/8217186 to your computer and use it in GitHub Desktop.
Save serpent403/8217186 to your computer and use it in GitHub Desktop.
Handy Linux Commands
# String replacement across multiple files
# '' -e done for osx
grep -rl string1 * | xargs sed -i '' -e 's/string1/string2/g'
# Search (options : recursive, case insensitive, line number, directories to exclude)
grep -r -i -n --exclude-dir={log,tmp,config,spec} 'search-string' *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment