id命令
来源:原创 更新时间:2018-08-23 16:06:48 作者:管理员 浏览:2132
- 命令描述
- 命令语法
- 命令选项
--version 显示版本信息。
------------------------------------------------------------------------
-g --group 显示用户所属群组的ID。
-G --groups 显示用户所属附加群组的ID。
-n --name 显示用户,所属群组或附加群组的名称。
-r --real 显示实际ID。
-u --user 显示用户ID。
-a 忽略,与其他版本兼容
- 命令参数
- 命令实例
实例1: 显示用户所有组ID
[root@linuxbaodian test]# id -G linuxbaodian 888 0 [root@linuxbaodian test]# id linuxbaodian uid=505(linuxbaodian) gid=888(baodian) groups=888(baodian),0(root) [root@linuxbaodian test]# id -g linuxbaodian 888
实例2:显示当前用户
[root@linuxbaodian test]# id uid=0(root) gid=0(root) groups=0(root) [root@linuxbaodian test]# id -G 0 [root@linuxbaodian test]# id -g 0