On a Unix server every file has some permissions and you can alter them. A file permission tell you who has access to that file for different purposes. The permissions are set for three kind of people: Owner, Group and Others. Thus if you do ls -l and see permission like -rw-rw-rw- (this is just an example), then each string combination separated by a hyphen represents permissions for Owner, Group and Others.
For example:
-rw-r--r-- 1 rick rick 4103 2011-01-26 22:57 test.pl // This means that only user rick is allowed to read and write in test.pl, but can be only read by group members and other people.
You can set these permissions using numbers 0-7. Each number represent different permission. Here is a table:
| Number | Read (R) | Write (W) | Execute (X) |
|---|---|---|---|
| 0 | No | No | No |
| 1 | No | No | Yes |
| 2 | No | Yes | No |
| 3 | No | Yes | Yes |
| 4 | Yes | No | No |
| 5 | Yes | No | Yes |
| 6 | Yes | Yes | No |
| 7 | Yes | Yes | Yes |
So to give everyone read,write and execute permission you would do chmod 777 filename.
More examples:
666 is the same as rw-rw-rw- All have read and write permission
744 is the same as rwxr–r– – Owner have all the permissions however group members and others have only read access.