How to Use chmod to Change File Permissions in Linux

chmod changes read, write, and execute permissions for a file's owner, group, and others. Learn the numeric (755) and symbolic (u+x) notation.

Published September 20, 2026

chmod (change mode) sets which users can read, write, or execute a file, using either numeric notation (e.g. 755) or symbolic notation (e.g. u+x).

chmod 755 script.sh   # owner: rwx, group: r-x, others: r-x
chmod +x script.sh    # add execute permission for everyone

Steps

  1. Each permission set (owner, group, others) is a sum of read (4), write (2), and execute (1) — so 7 = rwx, 5 = r-x, 6 = rw-
  2. chmod 755 file sets owner to rwx (7), and group/others to r-x (5) each
  3. Symbolic notation uses u (user/owner), g (group), o (others), a (all), with + to add or - to remove a permission, e.g. chmod g+w file

How it works

Every file has three permission sets — owner, group, and others — each independently controlling read, write, and execute access. The numeric mode is just those three rwx sets expressed as three digits.

Things to watch for

  • Never use chmod 777 on files exposed to the internet — it grants write and execute permission to every user on the system, which is a serious security risk
  • For directories, execute permission (x) controls whether a user can 'enter' the directory (cd into it) or access files inside it by name — not run it as a program

FAQ

What does chmod 644 mean?

Owner gets read+write (6), group gets read-only (4), others get read-only (4) — a typical permission set for regular files that shouldn't be executable.

More Linux articles