117-101 · Question #230
Which chown command will change the ownership to dave and the group to staff on a file named data.txt?
The correct answer is D. chown dave:staff data.txt. See the full explanation below for the reasoning.
Question
Options
- Achown dave/staff data.txt
- Bchown -u dave -g staff data.txt
- Cchown -user dave -group staff data.txt
- Dchown dave:staff data.txt
How the community answered
(17 responses)- A6% (1)
- B12% (2)
- C6% (1)
- D76% (13)
Community Discussion
7D is the right answer. The chown command uses the colon syntax "chown owner:group file" to set both owner and group in a single operation, so "chown dave:staff data.txt" is the standard POSIX form you will see on every Linux distro and on the exam. Options A, B, and C use slash notation or flags that chown does not support.
Worth adding that GNU chown on Linux actually does accept dot notation too, so "chown dave.staff data.txt" still runs without error, which is legacy compatibility from early Unix, but the colon form is what LPIC-1 expects and what you should write on the exam.
D is right. The colon syntax, chown owner:group file, is the POSIX-standard form covered in man 1 chown under "OWNER[:GROUP]", and the slash form in option A is a legacy shorthand that some implementations accept but is not the syntax you want to commit to memory for the exam.
Saw this exact wording on my 101, picked D without blinking, colon separates owner from group, always.
Colon is right for the separator, but if you also blanked on the order when permissions and ownership flags pile up in the same command, that is where people drop points.
Does the colon separator also let you change just the group, like chown :staff data.txt?
Saw D on my actual exam, the colon syntax trips up everyone who guesses A.