As a sysadmin, you’ll often need to list all the users on your Linux system. Learn how to list all users in the Linux command line.
There are several ways you can obtain the list of users in Linux.
Show users in Linux using less /etc/passwdThis command allows sysops to list the the users that are locally stored in the system.
The list shows a lot more users than you expected because it lists all the system users too.
List Linux users with compgenIf you just want to list all the usernames without any additional information, you can use the compgen command with -u option.
A few tips about listing users in LinuxYou just saw three ways to view users in Linux.