linux

linux怎么查看log日志

清风
2758
2021-04-21 17:19:27
栏目: 智能运维

linux查看log日志的方法:1、打开终端;2、输入“tail -100f test.log”命令实时查看或者“cat -n test.log |grep "debug"”命令根据指定关键字查看日志即可。


linux怎么查看log日志


具体操作步骤:

1、在linux系统桌面下使用快捷键【Ctrl+Alt+T】打开终端命令行模式。

2、在linux终端命令行模式中输入以下命令查看log日志即可。


tail -100f 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-12-17 16:17:20/,/2014-12-17 16:17:36/p' test.log #根据日期查询日志



0
看了该问题的人还看了