Grep Recursive and Count

后端 未结 6 671
夕颜
夕颜 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 19:00

    grep -rc "my string" ./ | grep :[1-9] >> file_name_by_count.txt
    

    Works like a charm.

提交回复
热议问题