linux list users and groups code example

Example 1: how to see our already added users in linux

$ lslogins -u

UID USER       PROC PWD-LOCK PWD-DENY LAST-LOGIN GECOS
   0 root        144                              root
1000 tecmint      70                     10:39:07 TecMint,,,
1001 aaronkilik    0                              
1002 john          0                              John Doo

Example 2: ubuntu list users in group

getent group groupname

Example 3: linux list user group

groups [user name]
# [user name] : (optionnal) the user to list the group of
#                           default is the one executing the command.

Example 4: how to see our already added users in linux

$ users

tecmint
aaron

Tags:

Sql Example