ubuntu get user groups code example Example 1: ubuntu list users in group getent group groupname Example 2: group of user ubuntu groups <username>