010-100 · Question #8
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 can change both the owning user and the owning group of a file in a single invocation using the owner:group syntax.
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
(54 responses)- A4% (2)
- B15% (8)
- C2% (1)
- D72% (39)
- E7% (4)
Why each option
The chown command can change both the owning user and the owning group of a file in a single invocation using the owner:group syntax.
chmod changes the permission bits (read, write, execute) of a file and has no effect on ownership.
chage modifies user password aging and expiration policies and is unrelated to file ownership.
chuser is not a standard Linux/Unix command for changing file ownership.
chown accepts the format 'chown owner:group filename', allowing both the user owner and group owner to be changed simultaneously. It can also change only the owner or only the group when used with the appropriate syntax, making it the most versatile ownership command.
chgrp changes only the group ownership of a file and cannot simultaneously change the user owner.
Concept tested: chown command for changing file owner and group
Source: https://man7.org/linux/man-pages/man1/chown.1.html
Topics
Community Discussion
No community discussion yet for this question.