Show all your groups: groups
Show your current group: id
Subshell to a new group: newgrp group
Change group of a file: chgrp [-R]
group file-or-dir(s)
Change group permissions: chmod [-R] g+rwx
file(s)
Make a directory "sticky": chmod [-R] g+s dir(s)
See file group & perms.: ls -l
To see the names of all Unix groups you are currently a member of, use groups(1):
# groups
fac cda3101fa00 ocean revcomp cot3100sp01
(I am a member of these 5 groups. My default group, fac, is listed
first.)
To see which single group a given shell is currently associated
with, use id(1):
# id
uid=4044(mpf) gid=30(fac)
To start a new subshell of the current shell that is associated with a different group, use newgrp(1):
# newgrp ocean
# id
uid=4044(mpf) gid=1123(ocean)
# exit
# id
uid=4044(mpf) gid=30(fac)
Note the following: All applications you start from the shell inherit its group association and can write to files that are group-writable to that group. Note that applications you start from the window manager menus will inherit the window manager's group ID, which is probably just your default group. Therefore, if you want to edit a group-writable web page in netscape composer, for example, you will have to start netscape from within a shell that is associated with the group that owns that file.
Note also: newgrp starts a subshell. When you type exit, this does not log you out but instead just gets you back to your old shell, with its old group association.