The easy way of doing things is to look at it like this, there are three groups of people user, the users group, and others. There are 3 permissions levels read, write, and execute
the command chmod ugo+x means give the user, the users group, and everyone else execute privileges.
This could also be written chmod a+x for all may execute.
chmod 777 is the same as ugo=rwx it allows everyone to do everything.
to figure out the number code remember that the first digit represents the user, the next digit is their group, and the last digit is others. So you add 4 to each digit if they can read, 2 to each digit that can write, and 1 to each digit that can execute.
Additionally the = in the last post of mine was a typo, it should have been a +, I wasn't thinking when I wrote it. The command as I gave it would make it so everyone can only execute and not read or write. Using a + adds the permissions if they did not already exist and the - operator removes the permissions if they already existed.
WIKIS!!!!
http://en.wikipedia.org/wiki/Chmod
http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation