In Linux/Unix Machine we have various users which could login on machine to use its resource or even some users unable to login but has some applications access to run to make service available on machines.In this post we will how Linux list all users in the system

Some previous post on managing Linux users and Group.

1 Managing Users and Group part1 and part2
2. Linux Users & Groups

These are various ways to categories users according to their user, shells or home directory. We can list our systems, central authorised like LDAP, NIS users with various ways. In this post we will see some of these ways through which we could list our users.

In Linux/Unix machines, we have one file called /etc/passwd which contain all users list. This file format is described in another post. Let’s see another look on this file and understand some new facts about it.


This file contain user’s name and same other important facts for users which always used while user login on systems, but this file only contain systems local users. It’s possible to login through centralize mechanism like LDAP or NIS, which is widely used. But those users are not shown in this file, to see them we can use other commands like

getend password


getent group

In these outputs, we have first field User name, we can filter like below

awk -F: '{print $1}' /etc/passwd


cut -f 1 -d: /etc/passwd

In case we need to see specific users detail in /etc/passwd file, we could use use grep command for same to filter from /etc/passwd file.

▶ grep root /etc/passwd   

In Linux, we have one file which used to maintain some important parameters which has continuously used while creating any new local user in machine, like password expiration, login shell, home directory creation etc. In same way we have min_uid value which used to manage automatic value of next User ID, if we explicitly not used any uid while creating it