Courseiva
easyMultiple Select

XK0-006 Practice Question: Which TWO commands can be used to change the…

Which TWO commands can be used to change the group ownership of a file? (Choose exactly two.)

⚠ Common exam trap

The trap here is that candidates often forget `chown` can change group ownership using the colon syntax (e.g., `chown :group file`), leading them to select only `chgrp` or incorrectly choose `chmod` or `groupmod`.

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

✓

chgrp

Option B (chgrp) is correct because chgrp is the dedicated command for changing a file's group ownership, e.g. 'chgrp developers file.txt' sets the group of file.txt to developers. Option D (chown) is correct because chown can also change group ownership using the ':group' or '.group' syntax, e.g. 'chown :developers file.txt' or 'chown user:developers file.txt'. Option A (chmod) is incorrect because it modifies read/write/execute permission bits (and special bits like setgid), not the owning group itself. Option C (groupmod) is incorrect because it modifies attributes of an existing group in /etc/group, such as its name or GID, not a file's group ownership. Option E (usermod) is incorrect because it modifies user account attributes such as group membership, home directory, or shell, not file ownership.

Answer analysis

Option-by-option breakdown

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

  • ✗

    chmod

    Why it's wrong here

    chmod sets read, write and execute permission bits for owner, group and others; it cannot reassign a file's owning group. It is tempting because group permissions are edited with it, and it would be correct when adjusting what the owning group may do with the file, not who owns it.

  • ✓

    chgrp

    Why this is correct

    `chgrp` changes a file's group owner directly, satisfying the requirement to alter group ownership. It accepts either a group name or numeric GID, and supports recursive application with `-R` for directory trees. Unlike `chown`, which modifies user and group ownership together, `chgrp` targets only the group attribute, making it the precise tool here.

  • ✗

    groupmod

    Why it's wrong here

    groupmod alters a group's own attributes, such as its name or GID, and never touches file inode metadata. It is tempting because it is the dedicated group-management command, and it would be correct when renaming a group or changing its GID rather than changing which group owns a file.

  • ✓

    chown

    Why this is correct

    `chown` changes both user and group ownership, so prefixing the group with a colon (or dot) alters group ownership alone, satisfying the stem's requirement to change a file's group. It operates directly on the inode's GID field, unlike `chmod`, which only adjusts permission bits.

  • ✗

    usermod

    Why it's wrong here

    usermod changes a user account's primary group, home directory or shell, not the group ownership of an existing file. It is tempting because its name suggests group modification, and it would be correct when reassigning a user's primary group membership rather than a file's owning group.

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.