shell习题-给文档增加内容


在文本文档1.txt第5行(假设文件行数大于5)后面增加如下内容:

# This is a test file.

# Test insert line into this file.

 

参考答案:

sed -i "5a # This is a test file.\n# Test insert line into this file." 1.txt