LPIC-1 Exam 101 v5 (Linux Administrator) — Question 116
Consider the following directory:
drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales
Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)
Answer options
- A. chmod g+s sales
- B. setpol -R newgroup=sales sales
- C. chgrp -p sales sales
- D. chown --persistent *.sales sales
- E. chmod 2775 sales
Correct answer: A, E
Explanation
The command 'chmod g+s sales' sets the setgid bit on the directory, ensuring that new files inherit the group ownership from the directory. Similarly, 'chmod 2775 sales' also sets the setgid bit along with the appropriate permissions. The other options do not achieve the desired effect of ensuring new files are owned by the sales group.