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
In this tutorial:
- Linux Commands
- Command Shell Basics
- Editing commands
- Wildcards
- Redirection and piping
- Environment variables
- Shell scripts
- Directory and File Handling Commands
- The cd command
- The mkdir command
- The rmdir command
- The ls command
- The cp command
- The rm command
- The mv command
- The touch command
- The cat command
- Commands for Working with Packages and Services
- The rpm command
- Commands for Administering Users
- The usermod command
- The chage command
- The passwd command
- The newusers command
- The groupadd command
- The groupdel command
- Commands for Managing Ownership and Permissions
- The chgrp command
- The chmod command
- Networking Commands
- The ipconfig command
- The netstat command
- The ping command
- The route command
- The traceroute command