首页 > 代码库 >      review what i studied `date` - 2017-4-4

     review what i studied `date` - 2017-4-4

如果要在第二行即“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






     review what i studied `date` - 2017-4-4