report.sh is a regular file readable and writable by its owner.
Keep existing permissions and add only the owner's execute bit.
Which command is appropriate?
chmod u+x FILE adds the owner's execute bit while leaving unspecified permission bits unchanged.
Detailed explanation
chmod u+x report.shCorrect. It adds execute permission to the owner and preserves other bits.
Correct. It adds execute permission to the owner and preserves other bits.
chmod u-x report.shIncorrect. u-x removes the owner's execute bit.
Incorrect. u-x removes the owner's execute bit.
chmod a=x report.shIncorrect. a=x replaces all classes with execute-only permissions.
Incorrect. a=x replaces all classes with execute-only permissions.
chown u+x report.shIncorrect. chown changes ownership, not mode bits.
Incorrect. chown changes ownership, not mode bits.
Try it yourself
An example you can run in a temporary verification environment.
bash -c 'f=$(mktemp); chmod 600 "$f"; chmod u+x "$f"; stat -c %A "$f"; rm -f "$f"'Expected result
所有者がrwx、グループとその他が---の権限表示Key points
- u means owner
- + means add
- x means execute
Notes
- Environment: GNU coreutils chmod/stat / 一時ファイル
- 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.