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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
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.
find . -type f | xargs grep -l "search-pattern"
grep -R "search pattern" *