使用sed命令在某一行插入内容的方法

使用sed命令在某行插入命令的方法如下:

sed -i '5i hello world ’ mytest.sh

解释:
sed -i 插入命令
5i为第五行
hello world 为插入的内容
mytest.sh 为需要插入文本的名称。

猜你喜欢

转载自blog.csdn.net/weixin_44881103/article/details/100132777