list all users ubuntu code example

Example 1: mysql list users on ubuntu

SELECT User FROM mysql.user;

Example 2: list users in linux

cat /etc/passwd

Example 3: 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 4: how to get list of users in ubuntu

cat /etc/passwd
#check list of users in linux ubuntu

Example 5: list all user ubuntu server

cut -d: -f1 /etc/passwd