id命令简介:

    此命令用于查看用户的帐号属性信息 

1命令格式:

     id [option] USERNAME

2命令功能:

        用于查看系统中已存在用户账号的属性信息。

[root@xuelinux test1]# id tom

uid=666(tom) gid=666(tom) 组=666(tom),500(donggen)

   3命令参数:     

       -u  只查看用户的IDuid

       -g  只查看用户的组ID号gid

       -G  只查看用户的附加组idGID

       -n  查看用户信息以名称显示,不以ID号显示,搭配-u -g -G一起使用。


   4命令实例:

     1、id -u tom 显示用户tom的uid号     

[root@xuelinux test1]# id -u tom

666

      2、id -g tom 显示用户tom的gid号

[root@xuelinux test1]# id -g tom

666

      3、id -G tom 显示用户tom的GID号(附加组号)

[root@xuelinux test1]# id -G tom

666 500         默认附件组中一定有一个基本组以及其他附件组。

      4、id -G -n tom 显示用户tom的GID号(附加组号),并以名称显示

[root@xuelinux test1]# id -G -n tom

tom donggen

      5、