-1

What does -a and -G mean? Thanks.

sudo usermod -a -G www-data username
edwinksl
  • 23,789
Kadin
  • 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. –  Sep 06 '16 at 08:18

1 Answers1

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.

edwinksl
  • 23,789
  • 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 06 '16 at 02:50
  • 2
    Personally, I try man command-of-interest or command-of-interest --help first. – edwinksl Sep 06 '16 at 02:53