1.$含义
linux正则表达式$表示行尾字符,例如,word$表示待搜索的字符串(word)在行尾
2.样例
正则表达式$样例
命令:
grep -n "sda$" anaconda-ks.cfg
表示搜索行尾字符串为sda的行
[root@elasticsearch ~]# grep -n "sda$" anaconda-ks.cfg
10:ignoredisk --only-use=sda
27:bootloader --location=mbr --boot-drive=sda
[root@elasticsearch ~]#
本文介绍了Linux中正则表达式中的$符号,它用于匹配行尾字符。通过grep命令的-n选项,如`grep-nsda$anaconda-ks.cfg`,展示了如何搜索文件中行尾包含sda的行。
305

被折叠的 条评论
为什么被折叠?



