Skip to content

Instantly share code, notes, and snippets.

@frontrangerider2004
Created June 6, 2017 17:01
Show Gist options
  • Save frontrangerider2004/926977af9e60398d9e2888fbf0527ea6 to your computer and use it in GitHub Desktop.
Save frontrangerider2004/926977af9e60398d9e2888fbf0527ea6 to your computer and use it in GitHub Desktop.
Bash Onliners
# SED Search/Replace all files of type in a directory:
find ./ -type f -name "*.js" -print0 | xargs -0 sed -i .bak 's;<search-string>;<replace-string>'
# Find all files and exclude a pattern. The o option is essentially 'or' so this does exclude or print
find ./ -path "./my/path/to/ignore/" -prune -o -print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment