who -b
[root@localhost ~]# who -b
system boot May 10 12:21
last reboot
[root@localhost ~]# last reboot
reboot system boot 2.6.9-78.0.22.EL Tue May 10 12:21 (9+03:04)
reboot system boot 2.6.9-78.0.22.EL Tue May 10 11:21 (9+04:03)
reboot system boot 2.6.9-78.0.22.EL Sat May 7 17:00 (11+22:25)
reboot system boot 2.6.9-78.0.22.EL Fri May 6 18:51 (12+20:34)
reboot system boot 2.6.9-78.0.22.EL Sun May 1 12:04 (5+03:58)
wtmp begins Sun May 1 12:04:46 2011
[root@localhost ~]# last -x
root pts/1 192.168.7.82 Thu May 19 14:57 still logged in
root pts/1 192.168.7.82 Thu May 19 14:50 - 14:56 (00:05)
root pts/1 192.168.7.82 Thu May 19 13:11 - 13:14 (00:03)
root pts/1 192.168.7.82 Thu May 19 11:50 - 11:58 (00:07)
root pts/3 192.168.6.47 Thu May 19 09:46 - 14:04 (04:18)
root pts/1 192.168.6.47 Thu May 19 08:41 - 11:31 (02:49)
root pts/3 192.168.6.47 Wed May 18 16:21 - 18:06 (01:45)
root pts/3 192.168.6.40 Wed May 18 11:23 - 15:09 (03:45)
root pts/2 192.168.6.47 Wed May 18 10:50 - 16:14 (05:23)
root pts/1 192.168.6.32 Wed May 18 09:26 - 16:47 (07:20)
root pts/2 192.168.6.40 Tue May 17 19:46 - 20:50 (01:03)
root pts/2 192.168.6.32 Tue May 17 15:31 - 15:53 (00:21)
root pts/1 192.168.6.47 Tue May 17 14:39 - 21:06 (06:27)
root pts/1 192.168.7.82 Mon May 16 17:58 - 17:59 (00:00)
root pts/6 192.168.6.32 Mon May 16 16:55 - 18:17 (01:21)
root pts/5 192.168.6.40 Mon May 16 16:48 - 20:59 (04:11)
root pts/3 192.168.6.47 Mon May 16 16:03 - 18:21 (02:17)
root pts/2 192.168.6.40 Mon May 16 14:32 - 20:59 (06:27)
root pts/3 192.168.6.47 Fri May 13 17:06 - 18:55 (01:49)
root pts/2 192.168.6.40 Fri May 13 15:19 - 18:08 (02:49)
root pts/3 192.168.6.59 Thu May 12 20:00 - 20:52 (00:52)
root pts/5 192.168.6.59 Thu May 12 14:49 - 15:01 (00:11)
root pts/3 192.168.6.40 Thu May 12 14:34 - 18:02 (03:28)
root pts/2 192.168.6.47 Thu May 12 09:12 - 20:35 (11:23)
root pts/2 192.168.7.82 Thu May 12 09:08 - 09:08 (00:00)
root pts/2 192.168.6.47 Wed May 11 15:35 - 19:21 (03:45)
root pts/4 192.168.6.47 Wed May 11 14:10 - 19:21 (05:10)
root pts/3 192.168.6.32 Wed May 11 14:07 - 18:16 (04:08)
root pts/2 192.168.6.47 Wed May 11 10:42 - 14:55 (04:13)
root pts/2 192.168.7.82 Wed May 11 09:20 - 09:21 (00:00)
root pts/2 192.168.6.33 Tue May 10 15:59 - 18:01 (02:02)
root pts/1 192.168.6.32 Tue May 10 13:46 - 18:10 (04:23)
root pts/0 192.168.6.47 Tue May 10 13:45 - 20:54 (07:09)
runlevel (to lvl 3) 2.6.9-78.0.22.EL Tue May 10 12:21 - 15:26 (9+03:04)
root pts/2 192.168.6.47 Tue May 10 11:24 - crash (00:56)
root pts/1 192.168.6.32 Tue May 10 11:22 - crash (00:59)
root pts/0 192.168.6.47 Tue May 10 11:22 - crash (00:59)
runlevel (to lvl 3) 2.6.9-78.0.22.EL Tue May 10 11:21 - 12:21 (00:59)
reboot system boot 2.6.9-78.0.22.EL Tue May 10 11:21 (9+04:04)
root pts/2 192.168.6.32 Tue May 10 10:23 - crash (00:57)
root pts/1 192.168.6.47 Tue May 10 09:04 - crash (02:17)
root pts/0 192.168.6.40 Tue May 10 09:04 - crash (02:17)
root pts/4 192.168.6.40 Mon May 9 17:18 - 17:59 (00:41)
root pts/2 192.168.6.32 Mon May 9 17:09 - 18:04 (00:54)
root pts/2 192.168.7.82 Mon May 9 14:52 - 14:52 (00:00)
root pts/3 192.168.6.32 Mon May 9 13:41 - 18:04 (04:23)
root pts/3 192.168.7.82 Mon May 9 11:54 - 11:54 (00:00)
root pts/3 192.168.7.82 Mon May 9 11:41 - 11:49 (00:08)
root pts/2 192.168.6.32 Mon May 9 10:46 - 13:55 (03:08)
root pts/1 192.168.6.47 Mon May 9 08:53 - 18:04 (09:11)
root pts/0 192.168.6.47 Mon May 9 08:53 - 18:04 (09:11)
runlevel (to lvl 3) 2.6.9-78.0.22.EL Sat May 7 17:00 - 11:21 (2+18:21)
runlevel (to lvl 3) 2.6.9-78.0.22.EL Fri May 6 18:51 - 17:00 (22:08)
shutdown system down 2.6.9-78.0.22.EL Fri May 6 16:04 - 15:26 (12+23:21)
runlevel (to lvl 0) 2.6.9-78.0.22.EL Fri May 6 16:03 - 16:04 (00:00)
root pts/3 192.168.7.82 Fri May 6 12:07 - 12:08 (00:00)
root pts/2 192.168.6.47 Fri May 6 11:09 - 15:40 (04:30)
root pts/1 192.168.6.32 Fri May 6 10:32 - 15:41 (05:09)
root pts/4 192.168.6.40 Thu May 5 20:40 - 21:04 (00:24)
root pts/3 192.168.6.32 Thu May 5 15:33 - 18:01 (02:27)
root pts/3 192.168.7.82 Thu May 5 11:00 - 11:24 (00:24)
root pts/2 192.168.6.47 Thu May 5 10:05 - 21:04 (10:59)
root pts/1 192.168.6.47 Thu May 5 10:05 - 21:04 (10:59)
root pts/1 192.168.7.82 Thu May 5 09:49 - 09:50 (00:00)
root pts/2 192.168.7.82 Thu May 5 09:43 - 09:44 (00:00)
root pts/1 192.168.7.82 Thu May 5 09:42 - 09:45 (00:02)
root pts/0 192.168.6.47 Wed May 4 10:17 - 18:13 (07:56)
root pts/0 192.168.6.47 Tue May 3 10:48 - 18:09 (07:20)
root pts/0 192.168.7.82 Tue May 3 09:59 - 09:59 (00:00)
runlevel (to lvl 3) 2.6.9-78.0.22.EL Sun May 1 12:04 - 16:03 (5+03:58)
linux last 指令詳解
功能說明:列出目前與過去登入系統的使用者相關資訊。
語 法:last [-adRx][-f <記錄檔案>][-n <顯示列數>][帳号名稱...][終端機編号...]
補充說明:單獨執行last指令,它會讀取位于/var/log目錄下,名稱為wtmp的檔案,并把該給檔案的内容記錄的登入系統的使用者名單全部顯示出來。
參 數:
-a 把從何處登入系統的主機名稱或IP位址,顯示在最後一行。
-d 将IP位址轉換成主機名稱。
-f <記錄檔案> 指定記錄檔案。
-n <顯示列數>或-<顯示列數> 設定列出名單的顯示列數。
-R 不顯示登入系統的主機名稱或IP位址。
-x 顯示系統關機,重新開機,以及執行等級的改變等資訊。
本文轉自 holy2009 51CTO部落格,原文連結:http://blog.51cto.com/holy2010/568599