Tuesday, February 4, 2014

Search files by content

This is a little bash executable to search for files by their content in the current folder and subfolders:

if [ -z "$1" ]; then
echo "Usage: search <file patterns> <phrease to search in contents>"
exit 1
fi

find . -name "$1" | xargs grep -iR $2

No comments:

Post a Comment