Linux下使用ac命令顯示用戶總的連接時間
在Linux下,我們可以用ac命令顯示用戶登錄主機的時間信息。
目前登錄用戶的連接時間
ac命令中,使用 d 選項,可以將輸出的時間按天來顯示。在本例中,今天我已經登錄系統超過6個小時了,在12月1日,我登錄系統的時間大約是1個小時。
$ ac –d Dec 1 total 1.08
Dec 2 total 0.99
Dec 3 total 3.39
Dec 4 total 4.50
Today total 6.10
所有用戶的連接時間
就像下面所顯示的,可以用“-p” 顯示所有用戶的連接時間。注意這顯示了每一個用戶的總的連接時間。
$ ac -p
john 3.64
madison 0.06
sanjay 88.17
nisha 105.92
ramesh 111.42
total 309.21
顯示指定用戶的連接時間
$ ac -d sanjay
Jul 2 total 12.85
Aug 25 total 5.05
Sep 3 total 1.03
Sep 4 total 5.37
Dec 24 total 8.15
Dec 29 total 1.42
Today total 2.95
【編輯推薦】