Change analysts' GID to 3200 while keeping its name.
Which command is appropriate?
groupmod -g NEW_GID GROUP changes an existing group's numeric ID. Existing file ownerships should be reviewed separately.
Detailed explanation
groupmod -n 3200 analystsIncorrect. -n changes the group name.
Incorrect. -n changes the group name.
groupmod -g 3200 analystsCorrect. It changes analysts' GID to 3200.
Correct. It changes analysts' GID to 3200.
groupadd -g 3200 analystsIncorrect. groupadd attempts to create a new group.
Incorrect. groupadd attempts to create a new group.
usermod -u 3200 analystsIncorrect. usermod -u changes a user's UID.
Incorrect. usermod -u changes a user's UID.
Try it yourself
An example you can run in a temporary verification environment.
groupmod --help | grep -E -- '-g,|--gid'Expected result
new GIDの説明行Key points
- groupmod modifies an existing group
- -g selects the GID
- Check file group ownership
Notes
- Environment: shadow-utils groupmod 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.