I usually use grep word *
while being in a folder which includes files that have that word.
But in this folder i also have folders which under them there are files that have that word, what is the correct command for this matter please?
Thanks
I usually use grep word *
while being in a folder which includes files that have that word.
But in this folder i also have folders which under them there are files that have that word, what is the correct command for this matter please?
Thanks
find . -type f | xargs grep -l "search-pattern"
or
grep -R "search pattern" *
There's a recursive option to grep:
grep -R word *
You can replace "*" with a full path to a directory that you want to look at as using a wildcard will search for the word "word" in current directory.