Okay, that was quite a sidetrack. Let's return to permissions.
If you recall, the "ls -l" utility displayed several permission-related fields: Namely, the permission bits, the owner and the group name. We can use these three bits of information to determine who can read a file, delete or modify a file, or execute it if it is executable.
Let's look at the permission bits.
The permission bits specify three sets of three security specifications. Specifically, they define:
These 9 fields are represented in that order in the permission bits field of the ls-l command. If there is a "-" in the field that means that the file is "not" readable, writable, or executable depending on the field.
Of course, this is best shown by example. Consider the following:
Note that directories work just the same as files except that execution privilege represents the ability to move into the directory. If you do not give executable privileges to world and group, nobody can "cd" into the directory but you.
So the next obvious question is, how do you modify these permission fields? How do you change the permission bits, the owner and the user?