$ mkdir x
$ cd x
$ echo aa > .y
$ mkdir y
$ echo aa > y/z
$ echo aa > y/.z
$ grep -r a *
y/.z:aa
y/z:aa
Notice that hidden files in the top-level (.y) don't show up, but those in subdirectories (y/.z) do.It's kind of a gotcha. Fortunately one rarely finds dotfiles in subdirs.
The reason there are files that start with a dot is that ls(1) and globs starting with an asterisk ignore them by default. ls needs -a (all) to show them. Some shells, but not bash, provide a globbing syntax for the recursive expansion you think you require here.
But if, as normal, you want to grep recursively down from the current directory then that's what you should specify; just pass grep one path to search, dot, the current directory.
grep -r foo .
This is very basic knowledge of the Unix command line for a programmer and I highly recommend the classic text _The Unix Programming Environment_ by Kernighan and Pike to learn the philosophy behind Unix. It has nothing on window systems, ssh, etc., nor should it have as that's modern-day noise that hides the essence. It and Kernighan and Ritchie's _The C Programming Language_ were the key books every starting-out Unix programmer read. http://www.amazon.com/exec/obidos/ASIN/013937681X/mqq-20grep will run through all those files, if any, and recurse through all the directories, if any. grep recursing down a directory will process all the files/subdirs in that directory. (which includes . files).
If the shell can't expand the * , grep will receive a literal * and try to open a file/directory named * .