Create new group analysts with GID 3100.
Which command is appropriate?
groupadd -g GID NAME creates a group with an explicit numeric GID.
Detailed explanation
groupadd -n 3100 analystsIncorrect. groupadd -n is not the GID option.
groupmod -g 3100 analystsIncorrect. groupmod changes an existing group.
useradd -g 3100 analystsIncorrect. useradd creates a user, not a group.
groupadd -g 3100 analystsCorrect. It creates analysts with GID 3100.
Try it yourself
An example you can run in a temporary verification environment.
groupadd --help | grep -E -- '-g,|--gid'Expected result
GID指定の説明行Key points
- groupadd creates a group
- -g selects the GID
- groupmod changes an existing group
Notes
- Environment: shadow-utils groupadd help / 状態変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.