如果要在第二行即“bbbb”行的上添加一行,内容为“xiaowu”,可以把参数“a”换成“i”
[[email protected] shell]# sed ‘/b/i\xiaowu‘ file aaaa xiaowu bbbb cccc dddd [[email protected] 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
时间: 2024-12-26 12:42:21