Use the sed command to insert content in a certain line

Use the sed command to insert a command in a line as follows:

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

Explanation:
sed -i insert command
5i is the fifth line
hello world is the inserted content
mytest.sh is the name of the text to be inserted.

Guess you like

Origin blog.csdn.net/weixin_44881103/article/details/100132777