linux 中 grep命令检测出$符号
001、
[root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 xx yy$ kk ff ee 88 uu ee ww$ [root@pc1 test2]# grep "$" a.txt ## grep直接检测,检测不到 xx yy$ kk ff ee 88 uu ee ww$ [root@pc1 test2]# grep "\$" a.txt ## 增加转义字符,检测不到 xx yy$ kk ff ee 88 uu ee ww$ [root@pc1 test2]# grep "[$]" a.txt ## 正确做法,加中括号, 目前不知道为什么 xx yy$ kk uu ee ww$

。

浙公网安备 33010602011771号