Skip to content

Instantly share code, notes, and snippets.

@ChrisVilches
Created December 25, 2021 19:16
Show Gist options
  • Save ChrisVilches/2b81ba70bc31816b38e9c57dad42c349 to your computer and use it in GitHub Desktop.
Save ChrisVilches/2b81ba70bc31816b38e9c57dad42c349 to your computer and use it in GitHub Desktop.
Search text (inside files) in directory recursively in Linux
search-text(){
if [ ! -z "$1" ]
then
grep --exclude-dir={.git,tmp,log,node_modules,vendor} -r "$1" .
fi
}
# Example usage:
# search-text "with a suffix tree"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment