File Permissions and Sticky Bits Posted at www.linuxquestions.org by
jtshaw.
I'm not sure exactly what your question is here... but I can tell you
what those mean.
Lets start by ignoring the first number (the 4) and taking the last
three numbers.
The first of the last three numbers is the "owner permission", the 2nd
of the last three numbers is the "group permission", and the last
number is "others" or "world".
There are three bits of importance for each number. The Read, Write,
and Execute bits.
100 binary (aka 4 in decimal) means read only.
010 binary (aka 2 in decimal) means write only.
001 binary (aka 1 in decimal) means execute only.
To give multiple permissions you just add them. 110 (or 6, aka 4+2)
means read and write. 101 (or 5) means read and execute. 111 (or 7) is
read, write, and execute. These aren't all the combinations, but you
get the idea.
So, 777 means the files owner, group, and others
can read, write, and execute the file. 775 on the other hand means the
files owner and group can read, write, and execute while others can
only read and execute.
Now comes in the first number. It works exactly the same as the others
but each bit means something different.
100 binary (aka 4 in decimal) means the program will always execute as
if the owner ran it.
010 binary (aka 2 in decimal) means the prrogram will always execute
under the owning group.
001 binary (aka 1 in decimal) is the "sticky bit". This means the
program stays in memory even after execution is complete for faster
startup next time. Typically you don't need to set the sticky bit on
things unless it will be running over and over on a very short cycle.
You can combine these just like you could the read, write, and execute
permissions. If you only use 3 numbers in your chmod it assumes the
special bits are 0's. "chmod 0777 " is the same as "chmod 777 ". "chmod
4770 " isn't the same as "chmod 477 ".
Now... hopefully that was something on the line of what your looking
for...