day 27 sed

1、sed--打印 sed -n '/root/'p test.txt --#匹配含有root的行,没有“-n”选项则打印全部内容 sed -nr '/o+t/'p test.txt --#匹配的关键词含有特殊字符时,需要使用脱意字符,若加“-r”选项,则不需要使用脱意字符 sed -nr '/o{2}/'p test.txt --#匹配含两个“o”的行,加“-r”选项,不需要使用脱意字符 sed
相关文章
相关标签/搜索