Linux
chmod
Change permission bits, numeric or symbolic.
Concept core idea Watch out easy to get wrong
Concept
Key concepts
- Numeric mode sets all three triplets at once:
chmod 755 f(rwx/r-x/r-x),chmod 644 f(rw-/r--/r--). - Symbolic mode nudges bits:
chmod +x f(x for all),chmod u+x f(owner only); u=owner, g=group, o=others, a=all. - Missing x = 'Permission denied' when running
./script.shor a fresh binary — the #1 cause.
Watch out
Easily confused
numeric vs symbolic chmod
Numeric (
755) sets ALL bits at once. Symbolic (u+x) nudges specific bits without touching the rest.chmod vs chown
chmod changes the permission BITS; chown changes the OWNER/group. Different things.
Test yourself
5 questions on this lesson. Write your answers from memory, then compare them with the model answers side by side.