ubuntu see user assignment to groups code example
Example 1: add user to group
usermod -a -G examplegroup exampleusername
Example 2: group of user ubuntu
groups <username>
usermod -a -G examplegroup exampleusername
groups <username>