Add the set-group-ID bit to /srv/team while preserving its ordinary permissions.
Use it to help manage group ownership of new entries.
Which command is appropriate?
g+s sets setgid. On a directory, newly created entries generally inherit the directory's group, which helps shared-workspace administration.
Detailed explanation
chmod u+s /srv/teamIncorrect. u+s sets setuid rather than setgid.
Incorrect. u+s sets setuid rather than setgid.
chmod +t /srv/teamIncorrect. +t sets sticky bit.
Incorrect. +t sets sticky bit.
chmod g+x /srv/teamIncorrect. g+x only adds execute/search permission.
Incorrect. g+x only adds execute/search permission.
chmod g+s /srv/teamCorrect. chmod g+s /srv/team sets the directory setgid bit.
Correct. chmod g+s /srv/team sets the directory setgid bit.
Try it yourself
An example you can run in a temporary verification environment.
chmod --helpExpected result
記号モードのg+sでset-group-IDを指定できるKey points
- g+s means setgid
- Preserve ordinary permissions
- Useful for shared directories
Notes
- Environment: GNU coreutils 9.x/Linux
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.