Created
April 18, 2016 14:53
-
-
Save afunTW/a3b391692fccf53d309a285655fcf236 to your computer and use it in GitHub Desktop.
show the query result with color
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
#!/bin/bash | |
echo To show a string within ALL files in a given directory. Updated: 2016-01-10 | |
if [ $# -eq 0 ] | |
then | |
echo Usage: $0 [directory] [string] | |
else | |
echo Showing all \'$2\' under directory \'$1\' ... | |
grep -R -n --exclude-dir=node_modules --exclude-dir=lib --color=always "$2" "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment