(转)linux 查看当前用户及用户所属组别

 郑重声明:本文是笔者网上转载,所有权归原文作者!

地址:http://blog.chinaunix.net/uid-20648944-id-3190395.html

 

查看当前登陆的用户
$ who
loongson tty7         2012-04-27 08:58 (:0)
loongson pts/0        2012-04-27 09:00 (:0.0)
loongson pts/1        2012-04-27 09:00 (:0.0)
loongson pts/2        2012-04-27 09:15 (:0.0)


$ finger
Login     Name       Tty      Idle  Login Time   Office     Office Phone
loongson  loongson   tty7       12  Apr 27 08:58 (:0)
loongson  loongson   pts/0       4  Apr 27 09:00 (:0.0)
loongson  loongson   pts/1          Apr 27 09:00 (:0.0)

查看用户的信息
$ finger loongson
Login: loongson                   Name: loongson
Directory: /home/loongson               Shell: /bin/bash
On since Fri Apr 27 08:58 (CST) on tty7 from :0
    13 minutes 52 seconds idle
On since Fri Apr 27 09:00 (CST) on pts/0 from :0.0
   5 minutes 50 seconds idle
On since Fri Apr 27 09:00 (CST) on pts/1 from :0.0
No mail.
No Plan

查看用户所属组别
$ groups loongson
loongson : loongson adm dialout cdrom plugdev lpadmin admin sambashare libvirtd

添加用户到指定组:
# usermod -a -G testgroup loongson

posted @ 2013-02-03 14:47  怪人Kook  阅读(11002)  评论(0编辑  收藏  举报