業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Show user's group affiliation

Show user's group affiliation

To check which group a particular user belongs to, use the groups command.
If you run the command with no arguments, the group to which the user who executed the command belongs will be displayed.
If you specify the name of the user whose group you want to display as an argument, the group to which the user belongs will be displayed.

●Display the group to which the user who executed the command belongs.

[tama@Lion ~]$ whoami    ←Show user name
tama
[tama@Lion ~]$ groups  ←Show groups to which you belong
tama

●Display the group to which a specific user belongs.

[tama@Lion ~]$ groups nobody  ←Displays the group to which the "nobody" user belongs.
nobody : nobody
[tama@Lion ~]$
Copied title and URL