linux查看日志的方法:1、打开终端;2、通过“tail”、“head”、“cat”命令查看日志便可。
具体操作步骤:
1、首先通过快捷键【Ctrl+Alt+T】打开终端命令行模式。
2、输入以下命令查看日志便可。
#tail命令
tail ⑴00f test.log #实时监控100行日志
tail -n 10 test.log #查看日志尾部最后10行的日志
tail -n +10 test.log #查看10行以后的所有日志
#head命令
head -n 10 test.log #查看日志文件中的头10行日志
head -n ⑴0 test.log #查看日志文件除最后10行的其他所有日志
#cat
cat -n test.log |grep "debug" #查看指定关键字的日志信息
日志文件相干说明:
/var/log/message #系统启动后的信息和毛病日志,是Red Hat Linux中最经常使用的日志之一
/var/log/secure #与安全相干的日志信息
/var/log/maillog #与邮件相干的日志信息
/var/log/cron #与定时任务相干的日志信息
/var/log/spooler #与UUCP和news装备相干的日志信息
/var/log/boot.log #守护进程启动和停止相干的日志消息
本文来源:https://www.yuntue.com/post/69078.html | 云服务器网,转载请注明出处!

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