Difficulty: Easy
Correct Answer: chmod u+x letter
Explanation:
Introduction / Context:
UNIX permissions control who can read, write, or execute files. The chmod command modifies these permissions for the owner (u), group (g), and others (o). Knowing precise symbolic modes is essential when granting just the needed rights.
Given Data / Assumptions:
Concept / Approach:
Symbolic mode in chmod uses entity (u, g, o, a), operator (+, -, =), and permission (r, w, x). To add execute permission for owner only, use chmod u+x letter. This augments existing permissions rather than replacing them.
Step-by-Step Solution:
Verification / Alternative check:
List permissions with ls -l letter before and after; the first field’s owner triad should gain x (e.g., from rw- to rwx).
Why Other Options Are Wrong:
chmod ugo+x: Grants execute to everyone (owner, group, others). chmod u+w: Adds write, not execute. chmod g+x: Changes group, not owner. None of the above: Incorrect because chmod u+x letter is right.
Common Pitfalls:
Using = which replaces permissions entirely; accidentally granting execute to all users; forgetting that scripts also may need a valid shebang and executable bit.
Final Answer:
chmod u+x letter
Discussion & Comments