如何递归查找具有文本模式的文件,排除某些目录和文件?
Example:-
$ ls
bower.json bower_components configure results unit-tests
所以我需要在所有目录中递归查找“searchText”,但不包括bower.json和results。
find -type f -not -path './bower.json' -not -path './results/*' -exec grep 'searchString' -- '{}' +
,但是@RomanPerekhrest的答案更好。 - GKFX