Linux/Unix – Groups and How to Work with

Groups and How to Work in Them

 A group is a set of users, created to share files and to facilitate collaboration. Each member of a group can work with the group’s files and make new files that belong to the group. The system administrator can add new groups and give users membership to the different groups, according to the users’ organizational needs.

 For example, a system used by the crew of a ship might have groups such as galley, deck, bridge, and crew; the user captain might be a member of all the groups, but user steward might be a member of only the galley and crew groups.

 On a Linux system, you’re always a member of at least one group: your login group. You are the only member of this group, and its group name is the same as your username. Let’s look at how to manage your group memberships.

 

Listing the Groups a User Belongs To

 To list a user’s group memberships, use the group tools. Give a username as an argument, and groups output a line containing that username followed by all of the groups the user is a member of. With no arguments, group lists your own username and group memberships. To list your group memberships, type:

 $ groups

steward esdsvd mgsotoso

 In this example, three groups are output: steward (the user’s login group), esdsvd, and mgsotoso. To list the group memberships of user blackbeard, type:

 $ groups blackbeard

blackbeard : blackbeard

 In this example, the command outputs the given username, blackbeard, followed by the name of one group, blackbeard, indicating that user blackbeard belongs to only one group: his login group.

 

Listing the Members of a Group

 To list the members of a particular group, use the members tool, giving the name of the particular group as an argument. To output a list of the members of the esdsvd group, type:

 $ members esdsvd

captain steward mgsotoso

In this example, three usernames are output, indicating that these three users are the members of the

esdsvd group.

Advertisements

About msotela

This blog is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

Posted on March 15, 2009, in Unix/Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: