Networking / Beginners

The groupdel command

The groupdel command deletes a group. It has the following syntax:

groupdel group

Here's an example that deletes a group named castaways:

$ groupdel castaways

Poof! The group is gone.

The gpasswd command

You use the gpasswd command to administer a group. This command has several different syntax options.

To change the group password:

gpasswd [ -r | -R ] group

To add a user:

gpasswd -a user group

To remove a user:

gpasswd -d user group

To create group administrators and/or members:

gpasswd [-A administrators...] [-M members... ] group

The options are as follows:

  • -r: Removes the password from the group.
  • -R: Disables access to the group via the newgrp command.
  • -a: Adds the specified user to the group.
  • -d: Deletes the specified user from the group.
  • -A: Specifies one or more group administrators. Use commas with no intervening spaces to separate the administrators from each other. Each administrator must be an existing user.
  • -M: Specifies one or more group members. Use commas with no intervening spaces to separate the members from each other. Each member must be an existing user.

The following example adds seven group members and one administrator to a group called castaways:

$ gpasswd -A skipper -M skipper,marlin,professor,maryann, ginger,mrhowell,lovie castaways

If the rest of the group finally decides to throw Gilligan off the island, they can remove him from the group with this command:

$ gpasswd -d gilligan castaways
[Previous] [Contents] [Next]