![]() | 1 h2ero 2013-10-19 11:03:44 +08:00 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 17:53:54 +08:00 man sed addr1,+N Will match addr1 and the N lines following addr1. |
![]() | 4 rrfeng 2013-10-19 21:06:44 +08:00 [rr@mypc ~]#seq 10|sed '/3/,5d' 1 2 6 7 8 9 10 [rr@mypc ~]#^ |
![]() | 5 rrfeng 2013-10-19 21:07:30 +08:00 你是要删除 /aa/ 后的10行 还是 /aa/ 到 第 10 行 |