Sobes.tech
Middle

Access rights in Linux (chmod). What do the numbers mean?

sobes.tech AI

Answer from AI

In Linux, file and directory permissions are set using three digits in the chmod command, each digit representing the sum of permissions for:

  • The first digit — the owner of the file
  • The second — the group
  • The third — other users

Each digit is a sum of values:

  • 4 — read permission (r)
  • 2 — write permission (w)
  • 1 — execute permission (x)

For example, chmod 754 filename means:

  • Owner: 7 = 4+2+1 = rwx
  • Group: 5 = 4+0+1 = r-x
  • Others: 4 = 4+0+0 = r--

Thus, the owner can read, write, and execute; the group can read and execute; others can only read.