What option is specified in the usermod command to append a user to a group?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The correct option to append a user to a group in the usermod command is -a. When using the usermod command, the -a (append) option allows you to add a user to a supplementary group without removing them from other groups they may already belong to. This is particularly important because, without this option, the user would be removed from all groups except for the one specified with the -G option.

For example, if you want to add a user named "john" to an additional group called "developers," the command would typically look like this: usermod -a -G developers john. By using -a, you ensure that "john" retains his membership in all existing groups.

The other options serve different purposes: -g is used to specify a new primary group for the user, -u is for changing the user ID of the specified user, and -l is intended for renaming a user. Thus, these options do not pertain to adding a user to a group without affecting their current memberships.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy