欢迎访问linux宝典,请记住本站唯一域名:www.linuxbaodian.com

id命令

来源:原创    更新时间:2018-08-23 16:06:48    作者:管理员    浏览:2132
  • 命令描述
打印指定USERNAME的用户和组信息,或者(当省略USERNAME时)为当前用户打印。
  • 命令语法
id [选项] [参数]
  • 命令选项
- -help  显示帮助。
--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


上一条命令:passwd

下一条命令:groups

笔记分享

表情

共0条分享记录
  • 这篇文章还没有收到评论,赶紧来抢沙发吧~

相关内容

最受欢迎

猜你喜欢

最受争议