How to grep for the whole word

前端 未结 5 439
一生所求
一生所求 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:31

    You want the -w option to specify that it's the end of a word.

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

提交回复
热议问题