linux查看log日志的方法:1、打开终端;2、输入“tail ⑴00f test.log”命令实时查看还是“cat -n test.log |grep "debug"”命令根据指定关键字查看日志便可。
具体操作步骤:
1、在linux系统桌面下使用快捷键【Ctrl+Alt+T】打开终端命令行模式。
2、在linux终端命令行模式中输入以下命令查看log日志便可。
tail ⑴00f test.log #实时监控100行日志
cat -n test.log |grep "debug" #查看指定关键字的日志
相干操作命令:
cat -n test.log |grep "debug" #得到关键日志的行号
cat -n test.log |tail -n +92|head -n 20 #查看这个关键字前10行和后10行的日志
sed -n '/2014⑴2⑴7 16:17:20/,/2014⑴2⑴7 16:17:36/p' test.log #根据日期查询日志
本文来源:https://www.yuntue.com/post/68295.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏