LinuxCommandLibrary

addgroup

Create groups and manage group membership

TLDR

Create a new group

$ sudo addgroup [groupname]
copy
Create a system group
$ sudo addgroup --system [groupname]
copy
Add a user to an existing group
$ sudo addgroup [username] [groupname]
copy
Create group with specific GID
$ sudo addgroup --gid [1001] [groupname]
copy

SYNOPSIS

addgroup [options] group
addgroup [options] user group

DESCRIPTION

addgroup is a Debian/Ubuntu friendly frontend to the low-level groupadd command. It creates new groups or adds existing users to groups, following the naming policies and conventions defined in adduser.conf.
When adding a user to a group, it modifies /etc/group to include the user as a member. This is the recommended way to manage group membership on Debian-based systems.

PARAMETERS

--gid id

Specify the group ID (GID) for the new group
--system
Create a system group (GID from system range)
--allow-bad-names
Allow group names that don't conform to naming conventions
--conf file
Use alternate configuration file
--quiet
Suppress informational messages
--debug
Print debug information

CONFIGURATION

/etc/adduser.conf

Controls default behavior for addgroup and adduser, including GID ranges for normal and system groups, naming policies, and group creation defaults.

CAVEATS

Group names must follow naming rules defined in adduser.conf. System groups typically have GIDs below 1000. Users must log out and back in for new group memberships to take effect.

HISTORY

addgroup was created as part of the adduser package for Debian, providing a user-friendly interface for group management that follows distribution policies. It has been part of Debian since the mid-1990s.

SEE ALSO

groupadd(8), adduser(8), delgroup(8), groups(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community