Interview Q&A / Linux & Shell

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between symbolic and octal modes in chmod?

SHORT ANSWER

Octal mode sets all permissions at once with numbers such as 640. Symbolic mode edits specific bits with letters, such as u+x or go-w, leaving the rest unchanged. Symbolic is safer for small tweaks; octal is better for setting a known final state.

Explain it simply

Octal is like writing the complete answer sheet again; symbolic is like correcting one answer with a pen.

Octal: three digits for owner, group, others. Read is 4, write is 2, execute is 1. Add them up: 6 = rw-, 5 = r-x. So chmod 640 f means owner rw-, group r--, others nothing. It overwrites everything.

Symbolic: who (u, g, o, a), an operator (+ add, - remove, = set exactly) and what (r, w, x). chmod u+x script.sh adds execute for the owner and touches nothing else. chmod go-rwx secret.txt removes all group and others access. chmod a=r f sets read-only for everyone.

There is also capital X: chmod -R u+rwX,go+rX dir gives execute only to directories and files that already have it, handy for recursive changes.

Example

bash
touch run.sh
chmod 644 run.sh      # -rw-r--r--
chmod u+x run.sh      # -rwxr--r--
chmod go-r run.sh     # -rwx------
ls -l run.sh
# -rwx------ 1 user user 0 ... run.sh

What to say in the interview

"Octal sets the complete permission state in one go, such as 640. Symbolic changes only the bits I name, like u+x. I use symbolic for quick adjustments and octal when I want an exact known result, for example in deployment scripts."

Common mistakes

  • Using chmod -R 755 on a folder of data files, which makes every file executable.

#linux#permissions#chmod

Related questions

Practise more Linux & Shell questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Linux & Shell quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.