add user groups code example Example 1: add user to group usermod -a -G examplegroup exampleusername Example 2: linux user groups groups $username