It's simple, really.
7 rwx read, write, execute 6 rw- read, write 5 r-x read, execute 4 r-- read 3 -wx write, execute 2 -w- write 1 --x execute 0 --- no permissions
Here are a few examples :
chmod 777 (rwxrwxrwx) chmod 775 (rwxrwxr-x) chmod 666 (rw-rw-rw-)
Further Reading
http://en.wikipedia.org/wiki/Octal
http://en.wikipedia.org/wiki/Chmod












#1 by AnnaHopn at May 2nd, 2009
| Quote
kernelhack.com to GoogleReader!
AnnaHopn
#2 by Matt Simmons at May 3rd, 2009
| Quote
I learned it like this:
Where “u” is “user who owns the file”
“g” is “group who owns the file”
“o” is other users, in otherwords anyone who isn’t the user and isn’t in the group.
It works by flags:
uuu|ggg|ooo
—|—|—
rwx|rwx|rwx
—|—|—
421|421|421
You take whatever flags are set, add up the numbers below that, and that’s the mode:
rw-r–r–
42-4–4–
becomes
6 4 4