add user and group linux code example Example 1: ubuntu add user to group sudo usermod -a -G group username Example 2: linux user groups groups $username