Difficulty: Easy
Correct Answer: chmod u+x note
Explanation:
Introduction / Context:
Selective permission changes are common when turning a script into an executable. The chmod command supports symbolic modes that add (+), remove (-), or set (=) permissions for user (u), group (g), and others (o) without affecting unrelated bits.
Given Data / Assumptions:
Concept / Approach:
Use symbolic mode with the user class: u+x means “add execute for user.” It leaves group and others untouched. Verification is done via ls -l, which shows permission triplets as rwx.
Step-by-Step Solution:
Verification / Alternative check:
Execute the file (./note) if it is a script or binary. If permission denied appears, re-check owner and execute bit, and ensure the filesystem is mounted with exec allowed.
Why Other Options Are Wrong:
a: Grants execute to group, not owner.
b: Adds write, not execute, to owner.
d: Grants execute to user, group, and others, broader than requested.
e: Not applicable; option c is correct.
Common Pitfalls:
Accidentally overexposing a file with ugo+x; forgetting executable shebang for scripts; modifying permissions on a non-executable mount.
Final Answer:
chmod u+x note
Discussion & Comments