sed 分组替换
将文件以help开头的句子前加#
[root@localhost]# cat a.txt
help b help
help
1help
help2
help c help
[root@localhost]# sed "s/\(^help.*\)/#\1/g" a.txt
#help b help
#help
1help
#help2
#help c help
将文件以help开头的句子前加#
[root@localhost]# cat a.txt
help b help
help
1help
help2
help c help
[root@localhost]# sed "s/\(^help.*\)/#\1/g" a.txt
#help b help
#help
1help
#help2
#help c help