Managing group memberships

Some frequently used commands related to handling group memberships.

Listing members of a group called 'groupname':

egrep "^groupname" /etc/group

Listing the groups a user named 'username' is member of':

groups username

Adding the already existing user 'username' to an already existing group 'groupname':

usermod -a -G groupname username

Comments !

blogroll

social