010-100 · Question #47
Which of the following will change the group that is associated with a file?
The correct answer is C. chown. The 'chown' command changes file ownership and can also change the group associated with a file using the group syntax.
Question
Which of the following will change the group that is associated with a file?
Options
- Achmod
- Bchmod -w
- Cchown
- Dls -g
How the community answered
(47 responses)- A4% (2)
- B17% (8)
- C72% (34)
- D6% (3)
Why each option
The 'chown' command changes file ownership and can also change the group associated with a file using the group syntax.
'chmod' modifies file permission bits (read, write, execute) and does not change group ownership.
'chmod -w' removes write permissions from a file and has no effect on group association.
'chown' changes both the owner and group of a file. To change only the group, you use 'chown :groupname filename' or 'chown owner:groupname filename'. It directly modifies the group association stored in the file's inode metadata, which is what the question requires.
'ls -g' is a listing command that displays group information but does not change anything.
Concept tested: Changing file group ownership with chown
Source: https://man7.org/linux/man-pages/man1/chown.1.html
Topics
Community Discussion
No community discussion yet for this question.