原文:Linux如何通过命令查看日志文件的某几行(中间几行或最后几行)

Linux如何通过命令查看日志文件的某几行 中间几行或最后几行 linux 如何显示一个文件的某几行 中间几行 一 从第 行开始,显示 行。即显示 行 cat filename tail n head n 二 显示 行到 行 cat filename head n tail n 注意两种方法的顺序 分解: tail n :显示最后 行 tail n :从 行开始显示,显示 行以后的 head n ...

2018-01-31 20:28 0 3042 推荐指数:

查看详情

linux文件截取前几行后几行中间几行命令

1. 如果你只想看文件的前5行,可以使用head命令,如: head -5 /etc/passwd 2. 如果你想查看文件的后10行,可以使用tail命令,如: tail -2 /etc/passwd 或 tail -n 2 /etc/passwd tail ...

Fri Aug 09 22:04:00 CST 2013 0 4895
linux 查看日志最后几行

tail -n 50 wx.log 示例:查看/var/log/boot.log,只显示最后一行。则执行 tail -n 1 /var/log/boot.log tail -n 1000:显示最后1000行 tail -n +1000:从1000行开始显示,显示 ...

Tue Sep 11 22:00:00 CST 2018 0 18519
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM