Go to the previous, next section.

Changing File and Group Ownership

The group access to a file can be used to safely share files between members of a group and not anyone else. To change the group of a file, use chgrp. For instance if you wish to change file foo to group bin, execute:

chgrp bin foo

Then the file would look like (after doing a ls -lg):

-rw-r--r--  1 tot    bin           0 Sep  8 17:51 foo

However, in this case, you usually must be a member of the group you are changing to, or the system will not allow such a command. To have a group created, if one does not exist with the people you want to share access to a file, you will need to contact sysgroup (see section Sysgroup, for more info.) If you wish to change the ownership of a file, use chown. For instance if you wish to change the ownership of file foo to joe, execute:

chown joe foo

Then the file would look like (after doing a ls -l):

-rwxr-xr-x  1 joe         2437 Sep  8 15:59 foo

However, you usually can not change the ownership of a file, unless you have super-user privileges.

Go to the previous, next section.