Use pwd
to search from any directory you are in, recursing downward
grep -rnw `pwd` -e "pattern"
Update
Depending on the version of grep you are using, you can omit pwd
. On newer versions .
seems to be the default case for grep if no directory is given
thus:
grep -rnw -e "pattern"
or
grep -rnw "pattern"
will do the same thing as above!