010-150 · Question #6
Which of the following commands can be used to change both the owner AND group settings of a file?
The correct answer is D. chown. The chown command is the only standard Linux utility that can change both the owner and the group of a file in a single invocation.
Question
Which of the following commands can be used to change both the owner AND group settings of a file?
Options
- Achmod
- Bchage
- Cchuser
- Dchown
- Echgrp
How the community answered
(23 responses)- A9% (2)
- C4% (1)
- D74% (17)
- E13% (3)
Why each option
The chown command is the only standard Linux utility that can change both the owner and the group of a file in a single invocation.
chmod modifies the permission bits (read, write, execute) of a file but has no ability to alter ownership or group assignment.
chage modifies user account password aging policies such as expiry dates and warning periods - it operates on user accounts, not file metadata.
chuser is not a standard Linux command and does not exist in common Linux distributions.
chown accepts the syntax 'chown owner:group filename', where specifying a colon-separated pair updates both the owning user and the owning group atomically in one command, which no other listed tool can do.
chgrp changes only the group ownership of a file and cannot change the owning user, making it insufficient when both must be updated.
Concept tested: Changing file owner and group with chown
Source: https://man7.org/linux/man-pages/man1/chown.1.html
Topics
Community Discussion
No community discussion yet for this question.