Every directory and file on the system has an owner, and also an associated group. It also has a set of permission flags which specify separate read, write and execute permissions for the 'user' (owner), 'group', and 'other' (everyone else).
The 'ls' command shows the permissions and group associated with files when used with the -l option. An example of the output produced by 'ls -l' is shown below.
drwx------    2    richard    staff    2048    Jan 2 1997    private drwxrws---    2    richard    staff    2048    Jan 2 1997    admin -rw-rw----    2    richard    staff    12040    Aug 20 1996    admin/userinfo drwxr-xr-x    3    richard    user    2048    May 13 09:27    public
Field 1:   a set of ten permission flags
Field 2:   link count
Field 3:   owner of the file
Field 4:   associated group for the file
Field 5:   size in bytes
Field 6-8: date of last modification (format varies, but always 3 fields)
Field 9:   name of file (possibly with path, depending on how ls was called)
The permission flags are read as follows (left to right)
|1||directory flag, 'd' if a directory, '-' if a normal file|
|2,3,4||read, write, execute permission for User (Owner) of file|
|5,6,7||read, write, execute permission for Group|
|8,9,10||read, write, execute permission for Other|
|-||in any position means that flag is not set|
|r||file is readable by owner, group or other|
|w||file is writeable|
|x||file is executable. Execute permission on a directory means you can list the files|
The command to change the permission flags is "chmod". Only the owner of a file can change its permissions.
Usage: chmod [options] (who) (opcode) (permission) (filename)Options:
See the online manual pages for details of these commands on any particular system (e.g. "man chmod").
Examples of typical useage are given below:
chmod g+w myfile
chmod g-rw myfile
chmod g+rwx mydir
chmod u=rw,go= privatefile
chmod -R g+rw .