What does `usermod -aG` mean?

The command usermod -aG is used in Linux to modify user accounts. Here's a breakdown of its components:

  • usermod: This is the command used to modify a user account.

  • -a: This option stands for "append." It allows you to add the user to the specified group(s) without removing them from any other groups they are already a member of.

  • -G: This option specifies the group(s) to which you want to add the user. You can list multiple groups separated by commas.

For example, the command:

sudo usermod -aG farmers worker1

This command adds the user worker1 to the group farmers while preserving any other group memberships that worker1 may already have.

0 Comments

no data
Be the first to share your comment!