Courseiva
easyMultiple Choice

XK0-006 Practice Question: Which command can be used to display the current…

Which command can be used to display the current user's effective user ID and group memberships?

⚠ Common exam trap

CompTIA often tests the distinction between `whoami` (which shows only the effective username) and `id` (which shows both the effective user ID and group memberships), leading candidates to choose `whoami` when the question asks for the effective user ID and group memberships together.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

id

The `id` command displays the current user's real and effective user ID (UID), group ID (GID), and supplementary group memberships. It provides a comprehensive view of identity and group associations, which is essential for understanding access rights in Linux security contexts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    id

    Why this is correct

    The `id` command queries the kernel for the calling process's credentials, printing the effective user ID (EUID), primary group ID and supplementary group list. This directly satisfies the stem's requirement for effective UID plus group memberships, unlike `whoami`, which returns only the username.

  • ✗

    who

    Why it's wrong here

    who lists logged-in users and their terminals, not the caller's effective UID or group memberships. It is tempting because it reports user identity information, but it draws from the utmp session database rather than the process credentials that id exposes.

  • ✗

    groups

    Why it's wrong here

    groups prints only the supplementary group names for a user, omitting the effective user ID and the primary group. It is tempting because group membership is half the requirement, yet it never reports UID, so it cannot satisfy the full question.

  • ✗

    whoami

    Why it's wrong here

    whoami prints only the effective username, with no numeric user ID and no group memberships at all. It is tempting because it is the quickest identity check, but it answers a narrower question than the one asked.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.