nerdexam
LPI

117-010 · Question #39

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

The correct answer is D. id. See the full explanation below for the reasoning.

Question

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

Options

  • Awhoami
  • Blsgroup
  • Cwho
  • Did

How the community answered

(49 responses)
  • A
    16% (8)
  • B
    8% (4)
  • C
    4% (2)
  • D
    71% (35)

Community Discussion

4
Viktor S.Viktor S.Mar 25, 2026

The answer is D, the id command. Run it and you get your user ID, your primary group ID, and every supplementary group you belong to, all in one shot. That is exactly what the question is testing. whoami just prints your username, nothing else, so A is out immediately. who shows who is logged into the system, not group memberships, so C is wrong. lsgroup does not exist as a standard Unix command, so B is a distractor designed to catch people who are guessing. If you actually understand that id prints uid, gid, and groups, you will never second-guess this on the exam or on the job.

10
Mei-Ling H.Mei-Ling H.Mar 27, 2026

D is right, but do you know why "whoami" alone is not enough here?

5
Mateus R.Mateus R.Apr 3, 2026

The id command is your ID badge, showing user, group, and all group memberships at once.

2
Nina C.Nina C.Mar 20, 2026

Panicked on this one, then id clicked for groups, marked D.

1
Full 117-010 Practice