linux sed

指定位置后插入行

sed -i '/match reg/a\line1\nline2' target.txt

指定位置前插入行

sed -i '/match reg/i\line1\nline2' target.txt

posted @ 2018-08-08 10:58  lennyT  阅读(229)  评论(0)    收藏  举报