How to grep for the whole word

前端 未结 5 449
一生所求
一生所求 2020-11-30 02:48

I am using the following command to grep stuff in subdirs

find . | xargs grep -s \'s:text\'

However, this also finds stuff like

5条回答
  •  情话喂你
    2020-11-30 03:14

    You can drop the xargs command by making grep search recursively. And you normally don't need the 's' flag. Hence:

    grep -wr 's:text' 
    

提交回复
热议问题