Add only group write permission to team.conf while preserving its other existing permissions.
Which command is appropriate?
Symbolic g+w selects the owning group and adds write permission without replacing other mode bits.
Detailed explanation
chmod u+w team.confIncorrect. u selects the owner.
chmod g+w team.confCorrect. chmod g+w team.conf adds group write permission.
chmod o+w team.confIncorrect. o selects other users.
chmod g-w team.confIncorrect. g-w removes group write permission.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp); chmod 640 "$tmp"; chmod g+w "$tmp"; stat -c '%a' "$tmp"; rm -f "$tmp"Expected result
660Key points
- u is owner
- g is group
- + adds
Notes
- Environment: GNU coreutils 9.x / 一時ファイル
- Use a disposable file or directory when checking chmod calculations.
- Exact permission display can vary slightly with filesystem and distribution defaults.
Foundation review
Place the operation
A symbolic chmod expression can change one subject and one bit while preserving unrelated mode bits.
Check the side effect
Confirm the subject selector before changing a shared file; g and o affect different audiences.