LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

groupadd

Create a new system group

TLDR

Create a new group
$ sudo groupadd group_name
copy
Create a system group
$ sudo groupadd -r group_name
copy
Create group with specific group ID
$ sudo groupadd -g 1001 group_name
copy
Create group with initial members
$ sudo groupadd -U user1,user2 group_name
copy

SYNOPSIS

groupadd [options] NEWGROUP

DESCRIPTION

groupadd creates a new group account on the system. It records the new group information in system files (/etc/group and /etc/gshadow), assigning a unique GID unless specified.System groups (created with -r) use GIDs from the system range defined in /etc/login.defs, typically below 1000.

PARAMETERS

-f, --force

Exit successfully if group exists; use next available GID if specified one is taken
-g, --gid GID
Set numerical group ID (must be unique unless -o used)
-K, --key KEY=VALUE
Override /etc/login.defs defaults
-o, --non-unique
Allow creation with duplicate GID
-p, --password PASSWORD
Set encrypted group password
-r, --system
Create a system group
-U, --users USER1,USER2
Add users as group members
-R, --root CHROOT_DIR
Apply changes in chroot environment
-P, --prefix PREFIX_DIR
Apply changes in prefix directory
-h, --help
Display help message and exit

INSTALL

sudo apt install passwd
copy
sudo pacman -S shadow
copy
sudo apk add shadow
copy
sudo zypper install shadow
copy
nix profile install nixpkgs#shadow
copy

CAVEATS

Group names must be 32 characters maximum and cannot start with dash, plus, or tilde. Names cannot contain colons, commas, whitespace, or be entirely numeric.

HISTORY

groupadd is part of the shadow-utils package for managing group accounts on Unix-like systems.

SEE ALSO

groupdel(8), groupmod(8), gpasswd(1), useradd(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid