linux中grep命令匹配标点符号

 

1、测试数据

root@DESKTOP-1N42TVH:/home/test2# ls
a.txt
root@DESKTOP-1N42TVH:/home/test2# cat a.txt
d ees j
x e.s u
z e s u
w e     s u
root@DESKTOP-1N42TVH:/home/test2# grep "e.s" a.txt
d ees j
x e.s u
z e s u
w e     s u
root@DESKTOP-1N42TVH:/home/test2# grep "e[[:punct:]]s" a.txt     ## [[:punct:]]表示标点符号
x e.s u

 

posted @ 2022-04-24 18:28  小鲨鱼2018  阅读(296)  评论(0编辑  收藏  举报