Quiz Entry - updated: 2026.07.14
How do you use chmod with the -R option and what are symbolic permission shortcuts?
-R walks a directory tree and applies the change to everything inside; bare operators like +x / -w / =r default to "all" (same as a+x) when you omit the who.
A real trap with recursive numeric modes: chmod -R 755 forces the execute bit onto files too, not just directories. Often you want execute on directories (to enter them) but not on data files. The symbolic capital-X helps here — chmod -R a+rX dir/ adds execute only to directories and to files that already had some execute bit, leaving plain data files alone.
Recursive permission change:
chmod -R 755 directory/ # Apply to directory and all contents
Symbolic shortcuts:
| Syntax | Meaning |
|---|---|
chmod +x |
Add execute for everyone (same as a+x) |
chmod -w |
Remove write for everyone |
chmod =r |
Set read-only for everyone |
Combining changes:
chmod u+rwx,g+rx,o-rwx file # Multiple changes at once
chmod u=rwx,g=rx,o= file # Set exact permissions
Permission calculation:
rwx = 4+2+1 = 7
r-x = 4+0+1 = 5
r-- = 4+0+0 = 4
**Go deeper:**
-  [chmod(1) — modes, including capital `X`](https://man7.org/linux/man-pages/man1/chmod.1.html) — the `X` (conditional execute) trick for recursive directory-vs-file safety.