【命令名称】 lastb
【使用权限】 root
【命令语法】 lastb
【功能说明】 显示过去时间里root登录时间,来源IP,日期等等
【常用参数】 参数很多,但是不常用,忽略,指定/var/log/btmp
【命令实例】
1.查看过去时间里root登录的时间段
[cxc@cxcserver ~]$ sudo lastb
root     tty1                          Mon Jan 7 12:58 - 12:58 (00:00)   
root     ssh:notty    192.168.20.247   Tue Dec 25 15:54 - 15:54 (00:00)   
root     ssh:notty    192.168.20.247   Tue Dec 25 15:51 - 15:51 (00:00)   
root     ssh:notty    192.168.20.247   Tue Dec 25 15:50 - 15:50 (00:00)   
root     ssh:notty    192.168.20.247   Tue Dec 25 15:47 - 15:47 (00:00)   
root     ssh:notty    192.168.20.247   Tue Dec 25 15:36 - 15:36 (00:00)   
root     tty1                          Sun Dec 23 20:09 - 20:09 (00:00)   
root     tty1                          Sun Dec 23 20:04 - 20:04 (00:00)   
root     tty1                          Sun Dec 23 19:53 - 19:53 (00:00)   
root     tty1                          Thu Dec 20 09:45 - 09:45 (00:00)   
root     tty1                          Fri Dec 14 18:10 - 18:10 (00:00)   
root     tty1                          Fri Dec 14 18:10 - 18:10 (00:00)   
 
btmp begins Fri Dec 14 18:10:15 2012
[cxc@cxcserver ~]$
 
 
【命令名称】 groups
【使用权限】 所有人
【命令语法】 groups
【功能说明】 查看用户所属的哪些组
【常用参数】 暂无
【命令实例】
1. 查看test所组哪些组
[cxc@cxcserver ~]$ groups test
test : test cxc
[cxc@cxcserver ~]$
 
【命令名称】 newgrp
【使用权限】 所有人
【命令语法】 newgrp
【功能说明】 修改当前用户初始群组
【常用参数】 暂无
【命令实例】
1 修改test初始群组
[test@cxcserver ~]$ groups
test cxc
[test@cxcserver ~]$ newgrp cxc
[test@cxcserver ~]$ groups
cxc test
[test@cxcserver ~]$