count number of lines in terminal output

后端 未结 4 1095
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 19:46

couldn\'t find this on SO. I ran the following command in the terminal:

>> grep -Rl \"curl\" ./

and this displays the list of files wher

4条回答
  •  甜味超标
    2021-01-29 20:30

    Pipe the result to wc using the -l (line count) switch:

    grep -Rl "curl" ./ | wc -l
    

提交回复
热议问题