Inspect app01's UID, primary GID, and supplementary groups in one command.
Which command is appropriate?
id USER displays the selected user's UID, primary GID, and group memberships.
Detailed explanation
getent passwd app01Incorrect. passwd data does not list all supplementary memberships.
getent group app01Incorrect. It finds a group with that name, not all groups for the user.
who app01Incorrect. who lists current login sessions.
id app01Correct. id app01 displays the requested identity information.
Try it yourself
An example you can run in a temporary verification environment.
id $(id -un)Expected result
uid=、gid=、groups=を含む現在ユーザーの情報Key points
- id shows identity
- Primary and supplementary groups
- Accepts a username
Notes
- Environment: GNU coreutils id / 現在ユーザーの読み取りのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.