Created
December 25, 2021 19:16
-
-
Save ChrisVilches/2b81ba70bc31816b38e9c57dad42c349 to your computer and use it in GitHub Desktop.
Search text (inside files) in directory recursively in Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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