I am working with a certain framework which has modules with consistent folder naming conventions. I would like to retrieve all files containing partial string
foo from a high level directory, but I only want results from files with a path containing a directory named
Bar. To elaborate: from the root directory of the project, there are generally four levels of subfolders, containing an arbitrary number of subfolders and text files all .php). The subdirectories in which I would like to search / from which I would like results all contain a parent folder named
Stated relative to my limited experience: I would like a command such as
grep -isrl 'foo' ./ and only receive results such as
Essentially, I assume there's something like
grep -isrl 'foo' ./*/Bar/*.php where
* will match zero-to-many subdirectories.