text 查看大型日志文件尾部的特定行
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 查看大型日志文件尾部的特定行相关的知识,希望对你有一定的参考价值。
# * 100,000,000-line file generated by seq 100000000 > test.in
# * Reading lines 50,000,000-50,000,010
# * Tests in no particular order
# * real time as reported by bash's builtin time
# https://unix.stackexchange.com/questions/47407/cat-line-x-to-line-y-on-a-huge-file
awk 'NR >= 57890000 && NR <= 57890010' /path/to/file
awk 'NR < 57890000 { next } { print } NR == 57890010 { exit }' /path/to/file
tail -n+50000000 test.in | head -n10
sed -n '50000000,50000010p;57890010q' test.in
head -n50000010 test.in | tail -n10
sed -n '50000000,50000010p' test.in
tail -n50000001 test.in | head -n10
ed -s test.in <<<"50000000,50000010p"
awk 'NR<57890000{next}1;NR==57890010{exit}' test.in
awk 'NR >= 57890000 && NR <= 57890010' test.in
以上是关于text 查看大型日志文件尾部的特定行的主要内容,如果未能解决你的问题,请参考以下文章
如何实时查看linux下的日志
Linux 查看日志的时候常用命令总结
linux怎么查看指定行的日志
linux 查看日志
Linux查看日志常用命令
linux中怎样查看日志