Monday, October 1, 2012

CHMOD


execute = 001 in binary = 1 in octal
write = 010 in binary = 2 in octal
read = 100 in binary = 4 in octal

So where does the 7 come from?

7 in binary = 111 in decimal = read, write, execute

So you get:

read write execute = 111 = 1 + 2 + 4 = 7
read write no execute = 110 = 4 + 2 = 6
read no write execute = 101 = 4 + 1 = 5
read no write no execute = 100 = 4
no read write execute = 011 = 2 + 1 = 3
no read write no execute = 010 = 2
no read no write execute = 001 = 1
no read no write no execute = 000 = 0

No comments:

Post a Comment