We can search a string recursively in a directory via grep command in linux.
Do the following:
grep -r "word" .
In which, -r stands for recursive.
More advanced option:
grep -ril "word" *.log
-i means ignore-case;
-l will only show the file name which contains the keyword, without printing the context of the keyword.
grep --exclude=*.txt -r "word" .
--exclude will search all the files in current directory whose file name does not match the pattern "*.txt".
grep --include=*.txt -r "word" *
Likewise, --include is just the opposite condition of --exclude.
If transfering, please annotate the origin: Jason4Zhu