linux 系统中 sed -n选项控制行的下移

时间:2021-07-08 09:57:16   收藏:0   阅读:40

1、

[root@centos79 test]# cat a.txt
1
2
3
4
5
6
7
8
9
10
[root@centos79 test]# sed /2/ s/^/xxx/ a.txt
1
xxx2
3
4
5
6
7
8
9
10
[root@centos79 test]# sed /2/ {n; s/^/xxx/} a.txt
1
2
xxx3
4
5
6
7
8
9
10

 

原文:https://www.cnblogs.com/liujiaxin2018/p/14984249.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!