LPIC-1 Administrative Tasks Practice Question
An administrator wants to change the owner of all files in /data to user 'web' without changing the group. Which command should be used?
⚠ Common exam trap
A common mix-up: candidates assume a colon is required or that `chown` without `-R` applies recursively, leading them to pick options that change the group or fail to affect all files.
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 web /data
`chown -R web /data` changes the owner of all files and directories recursively under /data to user 'web' while leaving the group ownership unchanged. The `-R` flag ensures recursion, and omitting a colon or dot after the username means only the owner is modified.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
chown -R web:web /data
Why it's wrong here
chown -R web:web /data recurses correctly but sets the group to web as well, violating the requirement to leave the group unchanged. The correct command is chown -R web /data, which alters only the owner. The user:group syntax is the right choice when both owner and group must be reassigned together.
- ✓
chown -R web /data
Why this is correct
chown -R web /data recursively changes the owner to web while leaving the group untouched, because only the user field is specified. Adding a colon and group, or using chgrp, would alter group ownership, which the scenario forbids.
- ✗
chown web /data
Why it's wrong here
chown web /data changes only the owner, satisfying the group requirement, but omits -R, so files and subdirectories inside /data keep their original owner. The correct command is chown -R web /data. Non-recursive chown suits changing ownership of a single file or an empty directory.
- ✗
chown web:web /data
Why it's wrong here
chown web:web /data sets both owner and group to web, altering the group the scenario says must stay unchanged. Omitting -R also leaves subdirectory contents untouched. The correct form is chown -R web /data, which recurses and changes only the owner. Specifying user:group is right when both owner and group must change.
Go deeper
Related to this question
About these practice questions
One of 402 original LPIC-1 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.