The -G docker option names the supplementary group to add.
The -a (append) flag keeps sam's existing supplementary groups; leaving it out would replace them.
The -s /bin/zsh option sets the new login shell.
Finally, sam is the account being modified, so everything is done in one invocation.
The other choices fail at least one requirement:
A command that omits -a drops all other group memberships.
Placing sam after the shell path (or after docker) makes the command operate on the wrong account.
Using two commands joined with "&&" is not a single step, and tools like gpasswd cannot set the login shell at all.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -aG option do in the usermod command?
Open an interactive chat with Bash
Why is the -s /bin/zsh option necessary when modifying a user?
Open an interactive chat with Bash
What is the difference between usermod and gpasswd?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access