After opening the file you need to read the file contents by fgets() function. fgets will read line by line from the file. While reading the file itself you can search the keyword from every line of the file.

Sample code,

lineno=0;
char *p="Pattern"; // Pattern to match.
while((fgets(line,MAX,"file_stream"))!=NULL)
{
lineno++; // Counting the lines.
if((strstr(line,p))!=NULL)
{
/* do some code */
}
}


Note:
strstr() function will match the sub string also.
If you want pure string match , use strcmp() instead of strstr().