nerdexam
LPI

010-100 · Question #39

Which command displays the list of groups to which a user belongs?

The correct answer is D. id. The id command displays a user's UID, primary GID, and all supplementary group memberships in a single output.

Security and File Permissions

Question

Which command displays the list of groups to which a user belongs?

Options

  • Awhoami
  • Blsgroup
  • Cwho
  • Did

How the community answered

(41 responses)
  • A
    7% (3)
  • B
    15% (6)
  • C
    2% (1)
  • D
    76% (31)

Why each option

The `id` command displays a user's UID, primary GID, and all supplementary group memberships in a single output.

Awhoami

`whoami` only prints the effective username of the current user and provides no information about group membership.

Blsgroup

`lsgroup` is not a standard Linux command and does not exist as a built-in utility.

Cwho

`who` shows which users are currently logged into the system and their login sessions, not group membership details.

DidCorrect

The `id` command prints the real and effective user ID (UID), primary group ID (GID), and the full list of all supplementary groups the user belongs to. Running `id username` for a specific user or `id` alone for the current user provides complete group membership information. This makes it the definitive command for answering questions about group membership on Linux systems.

Concept tested: Linux user and group identity lookup with id

Source: https://man7.org/linux/man-pages/man1/id.1.html

Topics

#id command#user groups#user identity

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice