Skip to content

Instantly share code, notes, and snippets.

@oxUnd
Created May 17, 2013 14:44
Show Gist options
  • Save oxUnd/5599503 to your computer and use it in GitHub Desktop.
Save oxUnd/5599503 to your computer and use it in GitHub Desktop.
search everything..
#!/usr/bin/env sh
usage () {
echo 'g <filename pattern> <search keyword>'
exit 1
}
if [ $# != 2 ]; then
usage
fi
pattern=$1
keyword=$2
search_folder=`pwd`
find "$search_folder" -name "$pattern" | xargs grep --color -n -E "$keyword"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment