grep string <files> is the command line for it.
For example if I type grep linux * in the /usr/src/linux directory I get a response like this:
REPORTING-BUGS:the command "sh scripts/ver_linux".
REPORTING-BUGS:[7.1.] Software (add the output of the ver_linux script here)
System.map:c020bed0 t udf_translate_to_linux
System.map:c0232fd0 T tioclinux
System.map:c03f32e8 D linux_banner
This shows me that REPORTING-BUGS and System.map have those lines in them with the string linux. There were obviously a lot more returned but I just wanted to show you an example of what the output looks like.
The reason why it didn't work the way you did it was all the text files were dumped to stdout and then directed into grep, so all the instances of the string it found were simply on stdout.