Frequently Asked Question
What's the difference between symbolic and octal chmod?
Symbolic mode names who you mean (u user, g group, o other, a all) and
what you want to do (+ add, - remove, = set exactly) followed by the bits
(r, w, x). chmod u+x script.sh adds execute for the owner; chmod g-w,o-w file removes write from group and others; chmod a=rwx file sets every
bit on for everyone. Symbolic mode is great for incremental changes because it
leaves the bits you do not mention alone.
Octal mode encodes the same nine bits as a three-digit (or four-digit, with
special bits) base-8 number: read is 4, write is 2, execute is 1, summed per
triplet. So chmod 755 script.sh sets rwxr-xr-x in one go, replacing whatever
was there before. Octal is concise, unambiguous, and what installation guides use
("chmod 600 your private key"). Both forms produce identical bits on disk; the
crucial difference is that octal replaces all nine bits while a symbolic form
like u+x only flips the one bit you named.