How Chmod Works

Linux file permissions are defined for three entities: the file Owner (user), the Group, and Public (others). Each entity can have three permissions:

  • Read (r): View file contents or list directory
  • Write (w): Modify file or add/remove files in a directory
  • Execute (x): Run as a program or enter a directory

Octal Notation

Each permission group is represented by a single octal digit (0–7), calculated as the sum of: Read = 4, Write = 2, Execute = 1.

For example, 755 means Owner has rwx (4+2+1=7), Group has r-x (4+0+1=5), and Public has r-x (4+0+1=5).

Symbolic Notation

A 9-character string like rwxr-xr-x directly shows each permission as r, w, x, or - (denied) in groups of three.