How to display the list of users on Linux from the command line?

How to display the list of users on Linux from the command line?

Use the command: sudo cat /etc/passwd | cut -d: -f1 to list users in the file /etc/passwd


The easiest and fastest way to display the list of users from the command line on Linux is to read the file /etc/passwd.

We could simply use:

sudo cat /etc/passwd

The return of this command is not easy to read, to do this we cut the result to have only the first part of each line which corresponds to the identifiers:

sudo cat /etc/passwd | cut -d: -f1

You know how to list users from the command line on Linux.




Leave a Comment