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
阅读(1094) | 评论(0) | 转发(0) |