[Linux] 查看系統啓動時間

查找系統最後啓動時間

1. 使用 who 命令

who -b

輸出:code

system boot  2015-10-14 00:51

2. 使用 last 命令

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 表示顯示系統關閉記錄以及運行級別的改變。文件

相關文章
相關標籤/搜索