grep "textstring" filename.
grep is for searching for strings or patterns of text in a file.
find is for locating files with specified names or other attributes on the system.
Start with man grep and man find. Then hop onto google and do some searching. There's tons
of info out there about how to use tools like this.
Edit: Here's an easy way to search for the lines in one file that exist in a second file:
grep -n -F -f fileB.txt fileA.txt
-n prefixes the line number
-F searches for fixed strings instead of regex patterns
-f specifies a file to take the strings/patterns from, instead of on the command line.
So in this case, search fileA.txt for the lines stored in fileB.txt, and print them along with their line number.