1
h2ero 2013 年 10 月 19 日
sed '/aa/,10d' a.txt
|
2
gouera OP [root@localhost ~]# wc -l a.txt
33 a.txt [root@localhost ~]# sed '/aa/,10d' a.txt [root@localhost ~]# @h2ero 貌似不对啊。 这个文件有33行。 删了10行还有23啊。。 怎么没输出了。 |
3
kemad 2013 年 10 月 19 日
man sed
addr1,+N Will match addr1 and the N lines following addr1. |
4
rrfeng 2013 年 10 月 19 日
[rr@mypc ~]#seq 10|sed '/3/,5d'
1 2 6 7 8 9 10 [rr@mypc ~]#^ |
5
rrfeng 2013 年 10 月 19 日
你是要删除 /aa/ 后的10行
还是 /aa/ 到 第 10 行 |