I am looking for a specific line (mainly in .c files) recursively from the root directory.
When I use this, I get the list almost immediately.
grep -rl "F_capture" .
However, if I try to speed up the process by simply searching for .c files:
grep -r --include=*.c "F_capture" .
As a result, I get a lot of recursive directory warnings, for example:
grep: warning: ./sys/block/fd0/device/bus/drivers/i8042/i8042/serio1/input:event1/subsystem/event3/device/bus/drivers/pcnet32/0000:00:03.0/subsystem: recursive directory loop
When I tried to suppress warnings using the -s option, I don't get a warning, but I get nothing - it seems like it is leaving to never land.
grep -rsl --include="*.c" "F_capture" .
So, I think my question is why the first grep I used returned something right away, and the other types in which I am configured for a specific file type seem to freeze. I think targeted searches will be faster.
source share