Thursday, February 26, 2009

028 显示用户连接的总计时长

ac命令用于显示用户连接系统的总计时长。
查看当前用户连接时长
选项–d 将按照天为单位显示用户的连接时间。在下面的例子中我今天已经登录系统6个小时了。在12月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

No comments:

Post a Comment