linux 中如何在指定行后面插入内容

 

001、

[root@pc1 test]# ls
a.txt
[root@pc1 test]# cat a.txt                ## 测试数据
1
2
3
4
5
6
[root@pc1 test]# sed '3a xx' a.txt        ## 在第3行后面插入内容
1
2
3
xx
4
5
6

 

posted @ 2022-10-29 01:19  小鲨鱼2018  阅读(93)  评论(0编辑  收藏  举报