who -b
輸出:code
system boot 2015-10-14 00:51
last reboot | head -1
輸出:ast
reboot system boot 3.13.0-32-generi Wed Oct 14 00:51 - 09:30 (5+08:39)
last 命令經過查找 /var/log/wtmp
文件,並顯示登陸登出用戶名單。登錄
last -x | grep shutdown | head -1
輸出:grep
shutdown system down 2.6.15.4 Sun Apr 30 13:31 - 15:08 (01:37)
參數 -x
表示顯示系統關閉記錄以及運行級別的改變。文件