lastコマンド
システム管理者 Unixパワーユーザのためのコマンドリファレンス

[ Linux / Unix リファレンスガイド ] ⇒ [ コマンドリファレンス ] ⇒ [ lastコマンド ]



last

ログイン履歴を表示

オプション
a ホスト名を最後列に表示する
d リモートログイン接続元などを表示
n 表示件数の指定。-数字でも同様の結果を得ることができる。
x シャットダウン、ランレベル変更履歴も合わせて表示
R ホスト名を非表示

使用例
# last 
usr01      pts/1        192.168.56.1     Sat Jul 13 06:00   still logged in
usr01      pts/0        :0.0             Sat Jul 13 06:00 - 06:01  (00:00)
usr01      tty7         :0               Sat Jul 13 06:00   gone - no logout
reboot     system boot  3.0.77-1vl6      Fri Jul 12 20:58 - 06:22  (09:23)
root       pts/1        192.168.56.1     Sat Jul  6 21:45 - down   (00:00)
root       pts/1        192.168.56.1     Sat Jul  6 21:28 - 21:45  (00:17)
usr01      pts/0        :0.0             Sat Jul  6 21:27 - down   (00:18)
usr01      tty7         :0               Sat Jul  6 21:27 - down   (00:18)
reboot     system boot  3.0.77-1vl6      Sat Jul  6 21:26 - 21:45  (00:19)
usr01      pts/0        :0.0             Sat Jul  6 21:24 - down   (00:01)
usr01      tty7         :0               Sat Jul  6 21:23 - down   (00:01) 
        
# last -a
usr01 pts/1 Sat Jul 13 06:00 still logged in 192.168.56.1
usr01 pts/0 Sat Jul 13 06:00 - 06:01 (00:00) :0.0
usr01 tty7 Sat Jul 13 06:00 gone - no logout :0
reboot system boot Fri Jul 12 20:58 - 06:25 (09:26) 3.0.77-1vl6
root pts/1 Sat Jul 6 21:45 - down (00:00) 192.168.56.1
root pts/1 Sat Jul 6 21:28 - 21:45 (00:17) 192.168.56.1
usr01 pts/0 Sat Jul 6 21:27 - down (00:18) :0.0
usr01 tty7 Sat Jul 6 21:27 - down (00:18) :0

# last -d
usr01 pts/1 192.168.56.1 Sat Jul 13 06:00 still logged in
usr01 pts/0 0.0.0.0 Sat Jul 13 06:00 - 06:01 (00:00)
usr01 tty7 0.0.0.0 Sat Jul 13 06:00 gone - no logout
reboot system boot 0.0.0.0 Fri Jul 12 20:58 - 06:26 (09:27)
root pts/1 192.168.56.1 Sat Jul 6 21:45 - down (00:00)
root pts/1 192.168.56.1 Sat Jul 6 21:28 - 21:45 (00:17)
usr01 pts/0 0.0.0.0 Sat Jul 6 21:27 - down (00:18)
usr01 tty7 0.0.0.0 Sat Jul 6 21:27 - down (00:18)


# last -x
runlevel (to lvl 3) 3.0.77-1vl6 Sat Jul 13 06:01 - 06:26 (00:25)
usr01 pts/1 192.168.56.1 Sat Jul 13 06:00 still logged in
usr01 pts/0 :0.0 Sat Jul 13 06:00 - 06:01 (00:00)
usr01 tty7 :0 Sat Jul 13 06:00 gone - no logout
runlevel (to lvl 5) 3.0.77-1vl6 Fri Jul 12 20:58 - 06:01 (09:02)
reboot system boot 3.0.77-1vl6 Fri Jul 12 20:58 - 06:26 (09:28)
shutdown system down 3.0.77-1vl6 Sat Jul 6 21:46 - 20:58 (5+23:12)
runlevel (to lvl 0) 3.0.77-1vl6 Sat Jul 6 21:45 - 21:46 (00:00)


# last -R
usr01 pts/1 Sat Jul 13 06:00 still logged in
usr01 pts/0 Sat Jul 13 06:00 - 06:01 (00:00)
usr01 tty7 Sat Jul 13 06:00 gone - no logout
reboot system boot Fri Jul 12 20:58 - 06:26 (09:28)
root pts/1 Sat Jul 6 21:45 - down (00:00)
root pts/1 Sat Jul 6 21:28 - 21:45 (00:17)
usr01 pts/0 Sat Jul 6 21:27 - down (00:18)
usr01 tty7 Sat Jul 6 21:27 - down (00:18)