June 2012
Beginner
227 pages
5h 43m
English
groups | Print the group membership of a user. |
dscl | Create, modify, and delete groups. |
A group is a set of accounts treated as a
single entity. If you give permission for a group to take some action
(such as modify a file), then all members of that group can take it. For
example, you can give full permissions for the group friends to read, write, and execute the file
/tmp/sample:
➜groupsusers smith friends ➜chgrp friends /tmp/sample➜chmod 770 /tmp/sample➜ls -l /tmp/sample-rwxrwx--- 1 smith friends 2874 Oct 20 22:35 /tmp/sample
To add users to a group, use dscl. To change the group ownership of a file,
recall the chgrp commands from File Properties.
Read now
Unlock full access