Linux命令:系统最近重启时间、错误日志
1、查看最近重启命令
[root@localhost ~]# last reboot
reboot system boot 2.6.18-164.el5 Wed Nov 10 10:41 (42+09:17)
在2010-12-22 20:19 重启了系统
可以看到正常命令重启显示为down,而电源强制重启为crash。
2、查看最近用户登录情况
[root@localhost ~]# last
oracle pts/1 10.1.1.1 Thu Dec 23 08:59 still logged in
reboot system boot 2.6.18-164.el5 Wed Dec 22 20:19 (12:59)
root pts/1 10.1.1.2 Sun Dec 12 13:07 – 13:59 (00:52)
3、查看操作系统的历史命令
[root@localhost ~]#history |more
382 top
383 df -lh
384 top
385 service iptables stop
386 last
387 last reboot
388 last
389 history
390 history |more
4、查看系统的错误日志信息
[root@localhost ~]#cat /var/log/messages |more
Dec 20 02:46:56 localhost xinetd[5248]: EXIT: telnet status=1 pid=12350 duration
=30(sec)
Dec 22 19:59:12 localhost shutdown[32014]: shutting down for system halt
Dec 22 19:59:12 localhost pcscd: winscard.c:304:SCardConnect() Reader E-Gate 0 0
Not Found