Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1454868
  • 博文数量: 263
  • 博客积分: 10851
  • 博客等级: 上将
  • 技术积分: 2627
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-26 22:40
文章分类

全部博文(263)

文章存档

2013年(4)

2012年(25)

2011年(33)

2010年(50)

2009年(138)

2008年(13)

分类: LINUX

2008-11-26 22:49:09

bash
 
法1. head -n 20 file | tail -n 10
法2. sed -n '11,20p' file
法3. awk 'NR>=11 && NR<=20' file
 
 
另附: 把第一行过滤掉(经常用在去掉输出的标题行), 可以用:
1. tail +2 file / tail -n +2 file
2. sed '1d' ur_file
3. awk 'NR>1' ur_file
 
man tail
-n, --lines=N
    output the last N lines, instead of the last 10; or use +N to output lines starting with the Nth
阅读(1047) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:头脑风暴的规则

给主人留下些什么吧!~~