Create developers with unused numeric GID 2400.
Which command is appropriate?
groupadd -g GID NAME creates a group with an explicit GID; check for collisions first.
Detailed explanation
groupadd -g 2400 developersCorrect. -g 2400 assigns the requested GID.
Correct. -g 2400 assigns the requested GID.
groupadd -u 2400 developersIncorrect. groupadd does not use -u for a UID.
Incorrect. groupadd does not use -u for a UID.
groupmod -g 2400 developersIncorrect. groupmod changes an existing group.
Incorrect. groupmod changes an existing group.
useradd -g 2400 developersIncorrect. useradd would create a user named developers.
Incorrect. useradd would create a user named developers.
Try it yourself
An example you can run in a temporary verification environment.
groupadd --help 2>&1 | grep -E -- '--gid|-g,' | head -n 1Expected result
-gまたは--gidの説明Key points
- groupadd creates
- -g sets GID
- Avoid duplicates
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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.