CSEE Help Pages
Unix

Unix Groups

UNIX allows a user to be a member of multiple groups. This is useful for projects, file sharing, etc. when it is desirable to have more than one user be able to modify a file. It is preferable to setup a new group for a specific project than to have a file be world-writable.

To create a new group, send mail to manager with a list of users, a proposed name, and a brief description of the use to which the new group will be put.

Your Group Memberships

You can use the Unix command groups to see your group memberships. Here's an example for Dave Maier:

state% groups maier
maier : Daemon Class PNL DSRG Pits Graefe Revelation

If you don't include a username with the groups command, it will default to listing the groups of the user who invoked the command.

Changing the group name of a file

The chgrp command may be used to change the group to which a file belongs. In addition to this, the chmod g+w filename command can be given to add write permission for members of the group to which the file belongs.

How can I tell which group a file is attached to?

If you run the command ls -lg filename a long listing will be printed showing the permission bits, the number of blocks the file occupies, the owner of the file, the group owner of the file, the size in bytes, the modification time, following by the filename:

    state% ls -lg .login
    -r--r--r--  1 root     System       4104 Dec  3  1993 .login

OHSU :: OGI :: CSEE :: Support :: CSEE :: Unix

This page was most recently revised on February 07, 2006.
Please address questions or comments to the webmaster.