How to grep for the whole word

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

    If you just want to filter out the remainder text part, you can do this.

    xargs grep -s 's:text '

    This should find only s:text instances with a space after the last t. If you need to find s:text instances that only have a name element, either pipe your results to another grep expression, or use regex to filter only the elements you need.

提交回复
热议问题