Grep Recursive and Count

后端 未结 6 656
夕颜
夕颜 2021-02-13 18:14

Need to search a directories with lots of sub-directories for a string inside files:

I\'m using:

grep -c -r \"string here\" *

How can I

6条回答
  •  隐瞒了意图╮
    2021-02-13 18:53

    I would try a combination of find and grep.

    find . | xargs grep -c "string here"
    

    Anyway, grep -c -r "string here" * works for me (Mac OS X).

提交回复
热议问题