sed -i '<位置> i <内容>' 文件,如:

*  sed -i '1 i abc' a.txt  -> 表示在a.txt文件的第一行插入abc

* sed -i '$ i abc' a.txt -> 表示在a.txt文件的最后一行插入abc

相关文章: