CompTIA Linux+ (XK0-005) — Question 200
The group owner of the /home/test directory would like to preserve all group permissions on files created in the directory. Which of the following commands should the group owner execute?
Answer options
- A. chmod g+s /home/test
- B. chgrp test /home/test
- C. chmod 777 /home/test
- D. chown -hR test /home/test
Correct answer: A
Explanation
The correct answer is A, as using 'chmod g+s' sets the setgid bit on the directory, ensuring that new files inherit the group of the directory. Option B changes the group ownership of the directory but does not affect new files. Option C sets overly permissive permissions, while Option D changes the ownership recursively, neither of which achieves the goal of preserving group permissions.