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.
Incorrect. u selects the owner.
chmod g+w team.confCorrect. chmod g+w team.conf adds group write permission.
Correct. chmod g+w team.conf adds group write permission.
chmod o+w team.confIncorrect. o selects other users.
Incorrect. o selects other users.
chmod g-w team.confIncorrect. g-w removes group write permission.
Incorrect. 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 / 一時ファイル
- 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.