Mode bits and symbolic changes
Translate `rwx` and octal modes into real access decisions.
chmod u+x
25 min read, 30 min lab
foundation
Linux file modes express permissions for user, group, and other. Symbolic changes such as `u+x` are often safer than replacing the entire mode because they describe intent narrowly.
A script will not run. You need to add execute only for the owner, not open it to everyone.
Worked command
$ ls -l deploy.sh-rw-r----- 1 app app 120 deploy.sh$ chmod u+x deploy.sh$ ls -l deploy.sh-rwxr----- 1 app app 120 deploy.sh
Do not use `chmod 777` as a debugging shortcut.
Inspect current mode, change the narrowest bit, inspect again.
deploy.sh is -rw-r----- owned by app:app and the owner cannot run it. You run `chmod u+x deploy.sh`. What changes?
Show the answer
Correct: A. Execute is added for the owner only; group and other are untouched
Symbolic `u+x` adds the execute bit to the user (owner) class and leaves group and other exactly as they were. The tempting distractor confuses `u` (owner) with `a` (all); only `a+x` or a full octal would touch every class.
Practice checklist
- Create a script in a disposable directory.
- Check its mode.
- Add owner execute with symbolic chmod.
- Verify the result.
Deliverable evidence
- Before and after `ls -l` output.
- A sentence explaining the changed bit.
shows: How a file's access splits into ownership (who) and mode bits (what) per user/group/other class, how umask seeds defaults, and where sudo crosses the boundary.
does not prove: It shows the model, not your case: only running ls -l, stat, id, and sudo -l on the actual file proves who you are and what access you currently hold.
Commit these to memory, then drill them until recall is automatic.
cue A script will not run; add execute for the owner only, without touching group or other.
show recall target
chmod u+x deploy.sh