addgroup command in Linux with Examples
Last Updated :
09 Oct, 2024
The add group command in Linux adds a new group to your current machine and allows you to modify its configuration. It is similar to the groupadd command, but it is more interactive and user-friendly.
Syntax
sudo addgroup [ options ] groupname
Installing the addgroup Command
If the addgroup tool is not already installed, you can install it based on your Linux distribution using one of the following commands
1. In case of Debian/Ubuntu
$sudo apt-get install addgroup
2. In case of CentOS/RedHat
$sudo yum install addgroup
3. In case of Fedora OS
$sudo dnf install addgroup
Key Options Used with addgroup Command
1. Add a New Group:
To add a new group, simply use the addgroup command followed by the group name.
sudo addgroup groupname

This command will create a new group for your Linux machine.
2. Add a New Group with a Specific Group ID (GID):
To create a group with a specified GID, use the --gid option.
sudo addgroup groupname --gid 12345

This command will add a new group with the specified group id.
3. Create a Group with a Specific Shell:
You can assign a specific shell to the group during its creation using the --shell option.
sudo addgroup groupname --shell /bin/sh

This command will allocate the /bin/sh shell to the newly create group.
4. Enter Verbose Mode:
To run the addgroup command in verbose mode and print details of all the tasks it is performing, use the --debug option.
sudo addgroup groupname --debug

This command will execute the command in the verbose mode that means it will print all details of the tasks it is executing.
5. Display Help:
To display the help section of the addgroup command, use the --help option.
addgroup --help

This command will display the help section of the addgroup command.
6. Display Version:
To check the version of the addgroup command, use the --version option.
addgroup --version

This command will display the version details of the addgroup command.
Conclusion
The addgroup command is a useful tool in Linux for creating and managing groups with additional configuration options such as group ID (GID) and shell assignment. Its user-friendly and interactive nature makes it a preferred choice over the groupadd command.
Similar Reads
adduser command in Linux with Examples adduser command in Linux is used to add a new user to your current Linux machine. This command allows you to modify the configurations of the user which is to be created. It is similar to the useradd command in Linux. The adduser command is much interactive as compared to useradd command. Installing
4 min read
apropos command in Linux with Examples Linux/Unix comes with a huge number of commands and thus it become quite difficult sometimes to remember each and every command. apropos command becomes useful in such cases. apropos command helps the user when they don't remember the exact command but knows a few keywords related to the command tha
3 min read
as command in linux with examples as command is the portable GNU assembler in Linux. Using as command, we can read and assemble a source file. The main purpose of 'as' is to assemble the output of the GNU compiler of the C language.as command reads and assembles the .s File. Also, whenever you do not specify the file, it normally re
3 min read
apt-get command in Linux with Examples The command-line tool `apt-get` is the most popular package management tool used in our Debian-based Linux operating system. This article provides an overview of `apt-get` and its basic syntax. It will include the most commonly used commands, their syntax, description, and examples. It also gives an
15+ min read
bc command in Linux with examples bc command is used for command line calculator. It is similar to basic calculator by using which we can do basic mathematical calculations. Arithmetic operations are the most basic in any kind of programming language. Linux or Unix operating system provides the bc command and expr command for doing
11 min read
cc command in Linux with Examples 'cc' command stands for C Compiler, usually an alias command to 'gcc' or 'clang'. As the name suggests, executing the 'cc' command will usually call the 'gcc' on Linux systems. It is used to compile the C language codes and create executables. The number of options available for the cc command is ve
3 min read
automake command in Linux with Examples automake is a tool used for automatically generating Makefile.in files compliant with the set GNU Coding Standards. autoconf is required for the use of automake. automake manual can either be read on-line or downloaded in the PDF format. More formats are also offered for download or on-line reading.
1 min read
aptitude command in Linux with examples The aptitude command in Linux provides a user-friendly interface to interact with the machine's package manager. It functions similarly to a control panel, like in Windows, allowing you to install, upgrade, and remove packages. The command can be used in either a visual interface or directly via the
4 min read
autoconf command in Linux with examples autoconf command is used in Linux to generate configuration scripts. Generate a configuration script from a TEMPLATE-FILE if given, or from âconfigure.acâ if present, or 'configure.in'. The output is sent to the standard output if TEMPLATE-FILE is given, otherwise, it is sent into âconfigureâ. To us
1 min read
ex command in Linux with examples ex (stands for extended) is a text editor in Linux which is also termed as the line editor mode of the vi editor. This editor simply provided some editing commands which has greater mobility. With the help of this editor, a user can easily move between files. Also, he/she has a lot of ways to transf
4 min read