Imagine the rwx permissions as three ON/OFF switches, so when all permissions are granted, this equates to 111 in binary. Each file or directory has three basic permission types:
read – The Read permission refers to a user’s capability to read the contents of the file.write – The Write permissions refer to a user’s capability to write or modify a file or directory.
execute – The Execute permission affects a user’s capability to execute a file or view the contents of a directory.
(000)Â 0 = No Permission
(001)Â 1 = Execute
(010)Â 2 = Write
(100)Â 4 = Read
|    Binary   |
   Octal   |
   rwx   |
 |  |
|---|---|---|---|---|
| Â Â Â 000Â Â Â |
   0   |
   ---   |
 |  |
| Â Â Â 001Â Â Â |
   1   |
   --x   |
 |  |
| Â Â Â 010Â Â Â |
   2   |
   -w-   |
 |  |
| Â Â Â 011Â Â Â |
   3   |
   -wx   |
 |  |
| Â Â Â 100Â Â Â |
   4   |
   r--   |
 |  |
| Â Â Â 101Â Â Â |
   5   |
   r-x   |
 |  |
| Â Â Â 110Â Â Â |
   6   |
   rw-   |
 |  |
| Â Â Â 111Â Â Â |
   7   |
   rwx   |
 |  |
Ref: https://linuxfoundation.org/blog/classic-sysadmin-understanding-linux-file-permissions/
Comments