Skip to content

Instantly share code, notes, and snippets.

@halfninja
Created March 27, 2012 14:07
Show Gist options
  • Save halfninja/2216171 to your computer and use it in GitHub Desktop.
Save halfninja/2216171 to your computer and use it in GitHub Desktop.
Recursive grep
#!/bin/bash
function usage() {
echo "Usage: deepgrep search-term file-pattern"
}
if [[ "$1" == "" || "$2" == "" ]]; then
usage
exit 1
fi
find . -name "$2" -exec grep -H "$1" {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment