|
This isn't exactly how the system stores it, but it's very close and is just an easy way to remember by using binary.
1. Consider each permission for owner, group, other to be three bits each hence
Owner - Group - Other
000 - 000 - 000
2. Remember this is binary so the value of each place of each of the three bits is 4, 2, and 1 so.
000
421 <- the values of the places in binary. Not total, consider each an individual number.
3. Unix style permissions always go read, write, execute so
RWX
000
421
4. When a bit is set then that permission is set so if you give full permission it becomes
RWX
111
421
and the binary to the octal number becomes 4 + 2 + 1 = 7
Read and Write become
RWX
110
421
the octal being 4 + 2 = 6
Read and Execute becomes
RWX
101
421
the octal being 4 + 1 = 5
Read only becomes
RWX
100
421
the octal being 4
With this the only thing you need to remember is the order of rwx and user,group and other and three binary places.
Ready and write for owner, read only for group and other become
RW-R--R--
110,100,100
4+2, 4, 4
and at comes out to 644
Read, Write, and Execute for the owner and Read, and Execute for group and other becomes
RWXR-XR-X
111,101,101
4+ 2 + 1, 4 + 1, 4 + 1
that comes out to 755
|