Learn Linux Log

#linux日志存放路径
[root@root log]#cd /var/log
[root@root log]# ls
anaconda       chrony                 cron-20200120  maillog           messages-20191222  secure           wtmp
audit          cloud-init.log         cron-20200126  maillog-20191222  messages-20200120  secure-20191222  yum.log
boot.log       cloud-init-output.log  dmesg          maillog-20200120  messages-20200126  secure-20200120  yum.log-20200120
btmp           cron                   dmesg.old      maillog-20200126  ppp                secure-20200126
btmp-20200120  cron-20191222          lastlog        messages          sa                 tuned
#查看前5行日志信息
[root@root log]# head -5 messages
#查看最后5行日志信息
[root@root log]# tail -5 messages
supplement

两个重要的系统日志文件
messages :State recording system or service running information and misinformation
secure(安全) :user login information, file information can be monitored to check whether there are too many fail record, to judge whether the server attack

tail -f 文件路径 Been tracking view the file contents change

Released four original articles · won praise 0 · Views 111

Guess you like

Origin blog.csdn.net/qq_44796087/article/details/104094950