sed 命令找到对应的行并将注释去掉

[root@localhost ~]# cat wa.txt
list-max-ziplist-entries 512
list-max-ziplist-value 64
# bind 127.0.0.1

[root@localhost ~]# sed -i '/^# bind 12.*/s/^# //' wa.txt   #找到准确的行并取消注释
list-max-ziplist-entries 512
list-max-ziplist-value 64
bind 127.0.0.1

 

posted on 2020-05-30 18:02  wangzy-Zj  阅读(1596)  评论(0编辑  收藏  举报