如果要在第二行即“bbbb”行的上添加一行,内容为“xiaowu”,可以把参数“a”换成“i”
[root@xiaowu shell]# sed '/b/i\xiaowu' file aaaa xiaowu bbbb cccc dddd [root@xiaowu shell]# sed '/bbbb/a\xiaowu' file aaaa bbbb xiaowu cccc bbbb xiaowu dddd #a是after,i是in front
消除vim “/” 标记高亮
#消除高亮:键入:noh就可以了。
转载于:https://blog.51cto.com/commonxu/1912935