Linuxコマンド  >  I  >  id
id
2009/07/14

id コマンドは、現在のユーザーの情報を表示する。

◆環境
OS Linux 2.6.18-92.el5

id のバージョンの確認

# id --version
id (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the t
erms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>
.
There is NO WARRANTY, to the extent permitted by law.

Written by Arnold Robbins and David MacKenzie.

使用例

# id
uid=0(root) gid=0(root) 所属グループ=0(root),1(bin),2(daemon),3(sys),
4(adm),6(disk),10(wheel)

ユーザー名だけを出力。

# id -un
root


2025/02/08 追記

◆環境
Platform Microsoft Azure
OS Ubuntu 24.04.1 LTS

id のバージョンの確認

$ id --version
id (GNU coreutils) 9.4
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Arnold Robbins and David MacKenzie.

使用例

$ id
uid=143(xxx@outlook.jp) gid=143(xxx@outlook.jp) groups=143(xxx@outloo
k.jp),110(admin),100(aad_admins)

ユーザー名だけを出力。

$ id -un
xxx@outlook.jp

▲ PageTop  ■ Home


Copyright (C) 2009 - 2025 ymlib.com