For school I have to do an assignment in which I need to use the grep
command within minix to search the source tree for files containing "int main(". With the source tree being stored in /usr/src
, I have the following command:
grep -rn --include=\*.c /usr/src/ "int main("
The problem is that I can't get the command to only search in .c
files.
So the question is: how do I search, using grep
, for any files containing "int main("
while only searching in .c
files?
Any help is very much appreciated.