常用语句

  • 查看最后100条记录
tail -n 100 test.txt
  • 查看最后100条,并继续输出后续的日志
tail -100f test.txt
  • 从100行开始查看到最后
tail -n +100 test.txt
  • 配合head查看第5行到第10行的数据
head -n 10 test.txt | tail -n 5