Command to check all users in Linux

In this article, we will see the command to check all users in Linux.

We can get the all users information from the file /etc/passwd. To get list of users, we are using cut and awk Linux commands.

1. Using awk command to list all local users you can use:

cut -d: -f1 /etc/passwd

2. Using awk command to list all local users you can use:

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