102-500 practice question 4 of 30
Which of the following commands can remove a user from a group?
Full set: 233 questionsThe usermod command is used to modify a user's account details. To manage a user's supplementary group memberships, the -G option is used. To remove a user from a specific group, you must provide a new, complete list of supplementary groups for the user with the -G option, omitting the group from which they should be removed. For example, usermod -G group1,group2 username will set the user's supplementary groups to only group1 and group2, effectively removing them from any others.
A. grouprm is not a standard Linux command. The command to remove a group is groupdel.
B. groupmod modifies group properties like name or GID, but is not the primary tool for changing a user's membership in that group.
C. passwd is used to manage user and group authentication information (passwords), not group membership lists.
D. usergroups is not a standard command for modifying group membership.
1. usermod(8) Linux manual page. The description for the -G, --groups option states: "If the user is currently a member of a group which is not listed, the user will be removed from the group."
2. Red Hat Enterprise Linux 8 Documentation, "Configuring basic system settings", Chapter 4. Managing local users and groups, Section 4.2.3. "Modifying a user account's group membership". This section provides examples of using usermod -G to change a user's list of supplementary groups.
3. "Linux Administration: A Beginner's Guide, Seventh Edition" by Wale Soyinka (a university-level textbook resource), Chapter 6: "Managing Users and Groups". It details the use of usermod -G for setting the supplementary group list.
Keep practicing
Take the free 102-500 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 102-500 practice questions
- Question 1What output is produced by the following command sequence? echo ‘1 2 3 4 5 6’ | while rea…
- Question 2Which command will set the local machine's timezone to UTC?
- Question 3Which of the following SQL statements will select the fields name and address from the co…
- Question 5Where are user specific crontabs stored?
- Question 6Which of the following crontab entries will execute myscript at 30 minutes past every hou…
- Question 8Which file, when using Sendmail or a similar MTA system, will allow a user to redirect al…
