Linux permissions
| Binary |
Octal |
String representation |
Meaning |
| 000 |
0 (0+0+0) |
- - - |
no permission |
| 001 |
1 (0+0+1) |
- - x |
execute |
| 010 |
2 (0+2+0) |
- w - |
write |
| 011 |
3 (0+2+1) |
- w r |
write + execute |
| 100 |
4 (4+0+0) |
r - - |
read |
| 101 |
5 (4+0+1) |
r - x |
read + execute |
| 110 |
6 (4+2+0) |
r w - |
read + write |
| 111 |
7 (4+2+1) |
r w x |
read + write + execute |
Permission structure (divided in 3 groups)
| owner |
group |
other |
| r w r |
r w |
r - x |
| Permission |
Binary |
| r w x |
4 + 3 + 1 = 7 |
| r - - |
4 + 2 + 0 = 6 |
| r - x |
4 + 0 + 1 = 5 |
| Permission |
765 |
| r - read |
w - write / edit |
x - execute |
|
| 4 - read |
2 - write / edit |
1 - execute |
|
Commands
chmod 777 file –> full access for everyone
chmod 755 file –> owner full, other read + execute
chmod 644 file –> owner read + write, other read