Change deploy.sh's owner to alice and owning group to devops.
Specify both in one command.
Which command is appropriate?
chown OWNER:GROUP FILE changes both owner and group. The colon separates the two names.
Detailed explanation
chown alice deploy.shIncorrect. This changes only the owner and leaves the group unchanged.
Incorrect. This changes only the owner and leaves the group unchanged.
chown alice:devops deploy.shCorrect. chown alice:devops deploy.sh sets both owner and group.
Correct. chown alice:devops deploy.sh sets both owner and group.
chgrp alice:devops deploy.shIncorrect. chgrp changes a group and does not take the OWNER:GROUP form.
Incorrect. chgrp changes a group and does not take the OWNER:GROUP form.
chmod alice:devops deploy.shIncorrect. chmod changes permission bits rather than ownership.
Incorrect. chmod changes permission bits rather than ownership.
Try it yourself
An example you can run in a temporary verification environment.
chown --helpExpected result
[OWNER][:[GROUP]]形式の使用法Key points
- OWNER:GROUP syntax
- Use a colon separator
- Both values change together
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.