Study for the TestOut Linux Pro Exam with our engaging quiz. Prepare using our flashcards and comprehensive multiple choice questions, each with hints and explanations to help you succeed. Get ready for your Linux certification today!

Practice this question and more.


According to command help, what does the -G switch do with the usermod command?

  1. Changes a user's primary group

  2. Renames a user account

  3. Assigns a user to a new list of supplementary groups

  4. Disables a user account

The correct answer is: Assigns a user to a new list of supplementary groups

The -G switch with the usermod command is used to assign a user to a new list of supplementary groups. When modifying a user account, this option allows you to specify additional groups that the user should belong to beyond their primary group. Supplementary groups provide additional permissions to users that are required for specific tasks or access to particular resources on the system. This is particularly useful in multi-user environments where users need varying levels of access based on different project requirements or file permissions. The distinction between secondary or supplementary groups and the primary group is important. The primary group is typically set during user creation and is the main group that a user belongs to for file ownership. By using the -G switch, an administrator can easily add a user to multiple supplementary groups in one command, streamlining permission management and user role assignments within the Linux operating system.