Forum Moderators: bakedjake
grep "mysearchkeyword" *
and then to go down the tree I'll add:
grep "mysearchkeyword" */*
grep "mysearchkeyword" */*/*
grep "mysearchkeyword" */*/*/*
grep "mysearchkeyword" */*/*/*/*
grep "mysearchkeyword" */*/*/*/*/*
grep "mysearchkeyword" */*/*/*/*/*/*
until it says:
grep: */*/*/*/*/*: No such file or directory
I was wondering if there's a flag to make it grep through all subdirectories?
My usual tool for this sort of thing is a combination of find and (e)grep, eg:
find . -type f -exec egrep pattern {} \;
And you can use some nice filtering in the find command.
Another variant, eg if you just want a list of names containing the pattern, is:
egrep -l `find . -type f -print`
Note the use of backquote rather than normal ' quotes.
Rgds
Damon