-1

What does -a and -G mean? Thanks.

sudo usermod -a -G www-data username
1
  • If you type usermod --help in terminal, you get some basic description of commands options. If you type man usermod you get a more detailed description. You can also find it online here.
    – user308164
    Sep 6, 2016 at 8:18

1 Answer 1

3

From man usermod:

   -a, --append
       Add the user to the supplementary group(s). Use only with the -G option.

   -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
       A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no
       intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option.

       If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be
       changed via the -a option, which appends the user to the current supplementary group list.

In short, sudo usermod -aG www-data username adds the username user to the www-data group.

2
  • Thanks. You mind telling me where I can find a list of all these types of commands. I searched, but could only find a list of basic commands.
    – Kadin
    Sep 6, 2016 at 2:50
  • 2
    Personally, I try man command-of-interest or command-of-interest --help first.
    – edwinksl
    Sep 6, 2016 at 2:53

Not the answer you're looking for? Browse other questions tagged .