I was wondering how they came up with a way to set permissions using chmod, just using numbers. For instance:
1 is for execute
2 is for write
4 is for read
Any sum of them gives a unique permission:
2+4 = 6 lets you write and read.
1+4 = 5 lets you execute and read
1+2+4 = 7 lets you execute, read and write
Is there an algorithm? Say, for example, I have 10 items, and I want to give a person a number and just a number that a person can determine which items I have selected.
source
share