grep C hello world
#include <stdio.h>
int main() {
FILE *file;
char line[100];
file = fopen("file.txt", "r");
while (fgets(line, sizeof(line), file)) {
if (strstr(line, "hello world")) {
printf("Found: %s", line);
}
}
fclose(file);
return 0;
}