303-300 · Question #62
Which command is used to set the owner and group of a file in Linux?
The correct answer is A. chown. chown (change owner) sets both the owner and group of a file, making it the correct choice - for example, chown user:group file.txt changes both in a single command. chmod is wrong because it modifies file permissions (read/write/execute bits), not ownership. chgrp can only…
Question
Which command is used to set the owner and group of a file in Linux?
Options
- Achown
- Bchmod
- Cchgrp
- Dsetfacl
How the community answered
(64 responses)- A88% (56)
- B3% (2)
- C2% (1)
- D8% (5)
Explanation
chown (change owner) sets both the owner and group of a file, making it the correct choice - for example, chown user:group file.txt changes both in a single command. chmod is wrong because it modifies file permissions (read/write/execute bits), not ownership. chgrp can only change the group, not the owner, so it's a partial answer at best. setfacl sets Access Control Lists, which are an extended permission system entirely separate from basic ownership.
Memory tip: Think of chown as "change owner" - and since an owner always belongs to a group, it handles both. If you see a question asking to change both owner and group together, chown is your one-stop command.
Topics
Community Discussion
No community discussion yet for this question.