模式匹配
1. 括号的分组标签,最多9组,依次为1...9
sed -r 's/^(address)/#\1/' /etc/network/interfaces
sed -r s/^\(address\)/#\\1/ /etc/network/interfaces
2. 用&代表匹配到的内容
sed -r 's/^address/#&/' /etc/network/interfaces
posted on 2015-09-24 16:09 eric.geoffrey 阅读(135) 评论(0) 编辑 收藏 举报