Grep Recursive and Count

后端 未结 6 659
夕颜
夕颜 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:59

    To output only file names with matches, use:

    grep -r -l "your string here" .
    

    It will output one line with the filename for each file which matches the expression searched for.

提交回复
热议问题