LPI
010-100 · Question #6
010-100 Question #6: Real Exam Question with Answer & Explanation
The correct answer is C. useradd -m -g users falco. The useradd command requires -m to create the home directory and -g to set the primary group, making option C the only syntactically correct command.
Question
What command line will create the user falco with home directory assigned to the group users as primary group?
Options
- Auseradd -g users falco
- Buseradd -f users falco
- Cuseradd -m -g users falco
- Dadd user falco@users
- Eadd -user falco -group users
Explanation
The useradd command requires -m to create the home directory and -g to set the primary group, making option C the only syntactically correct command.
Common mistakes.
- A. Option A uses -g to set the primary group correctly but omits -m, so no home directory is created for the user.
- B. The -f flag in useradd sets the number of days after a password expires before the account is disabled, not the primary group.
- D. 'add user' is not a valid Linux command; the correct utility is useradd (or adduser on some distributions with different syntax).
- E. 'add -user' is not a valid command or option syntax on any standard Linux distribution.
Concept tested. useradd flags for home directory and primary group
Reference. https://man7.org/linux/man-pages/man8/useradd.8.html
Community Discussion
No community discussion yet for this question.