Set the owner of /usr/local/bin/report to root and its group to ops.
Change mode bits separately.
Which command is appropriate?
chown OWNER:GROUP FILE changes both the file owner and group. Permission to make the change is normally required.
Detailed explanation
chmod root:ops /usr/local/bin/reportIncorrect. chmod changes mode bits and does not set owner:group.
Incorrect. chmod changes mode bits and does not set owner:group.
chown root:ops /usr/local/bin/reportCorrect. chown root:ops sets both ownership fields.
Correct. chown root:ops sets both ownership fields.
chgrp root:ops /usr/local/bin/reportIncorrect. chgrp handles a group, not the owner:group form.
Incorrect. chgrp handles a group, not the owner:group form.
usermod root:ops /usr/local/bin/reportIncorrect. usermod changes account attributes, not file ownership.
Incorrect. usermod changes account attributes, not file ownership.
Try it yourself
An example you can run in a temporary verification environment.
chown --help | sed -n '1,12p'Expected result
OWNER[:GROUP]形式を含むchownの使用法Key points
- chown changes ownership
- The colon separates owner and group
- The operation requires permission
Notes
- Environment: GNU coreutils chown / ヘルプ表示のみ
- 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.