What does chmod 777 mean in Linux?

chmod stands for change mode and it is used for changing the mode of access where as 777 is the ‘Octal Value’ of the file or directory permission. Here we discuss how to set read-write permissions for the web server.

The digits 7, 5, and 4 each individually represent the permissions for the user, group, and others. Each digit is a combination of the numbers 421, and 0:

  • 4 stands for “read”,
  • 2 stands for “write”,
  • 1 stands for “execute”, and
  • 0 stands for “no permission.”

So 7 is the combination of permissions 4+2+1 (read, write, and execute), 5 is 4+0+1 (read, no write, and execute), and 4 is 4+0+0 (read, no write, and no execute).

Each digit of the permissions number is a sum of 4, 2, 1 and 0:

  • 0 (0+0+0) – No permission.
  • 1 (0+0+1) – Only execute permission.
  • 2 (0+2+0) – Only write permission.
  • 3 (0+2+1) – Write and execute permissions.
  • 4 (4+0+0) – Only read permission.
  • 5 (4+0+1) – Read and execute permission.
  • 6 (4+2+0) – Read and write permissions.
  • 7 (4+2+1) – Read, write, and execute permission.

In the example below we have ‘Sybmolic Value’ where File, as denoted by the leading “-” within it’s symbolic value -rwxrwxrwx and Directory, as denoted by the leading “d” within it’s symbolic value drwxrwxrwx

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

r stands for read, w stands for write and x stands for execute.

Magento File system permission.

where permission MODE to apply(+), remove (-) or match (=)