Courseiva
Essential Commands →mediumMultiple Choice

LFCS Essential Commands Practice Question

An administrator must change the ownership of /srv/project and every file and directory beneath it to user alice and group devs, without altering permissions. Which command should be used?

⚠ Common exam trap

The trap here is assuming chmod can set ownership because both commands modify file metadata.

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

✓

chown -R alice:devs /srv/project

Changing both owner and group recursively is the job of chown with the -R flag and the user:group syntax. This updates ownership metadata on every file and directory under the target path while leaving permission bits intact. chmod, usermod, and chgrp each address different attributes and cannot fulfill the combined owner-and-group requirement.

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 -R alice:devs /srv/project

    Why it's wrong here

    This is invalid because chmod changes permission bits, not ownership, and its argument syntax expects symbolic or octal modes such as u+rwx or 755. Supplying alice:devs would be rejected as an invalid mode. Even if accepted, chmod cannot assign user or group ownership, so the requirement would not be met.

  • ✗

    chgrp -R alice:devs /srv/project

    Why it's wrong here

    This is wrong because chgrp changes only the group ownership, and it expects a group name, not a user:group pair. Passing alice:devs would be treated as a group name and fail. Even if a group named alice existed, the user ownership of the files would remain unchanged, so the requirement would not be satisfied.

  • ✗

    usermod -R alice:devs /srv/project

    Why it's wrong here

    This fails because usermod modifies account attributes for a user, not file ownership, and it does not accept a path as an argument. The -R flag for usermod relates to a chroot directory for the user's home, which is unrelated to changing ownership of an existing directory tree.

  • ✓

    chown -R alice:devs /srv/project

    Why this is correct

    This is correct because chown changes file owner and group, and the -R flag applies the change recursively through the directory tree. The syntax user:group sets both owner and group in one operation. Permissions are untouched, satisfying the requirement to change ownership only for /srv/project and everything beneath it.

About these practice questions

Courseiva writes every LFCS question from scratch — 406 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint

This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.