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.

Romain Drouche

Romain Drouche

Architecte Système | MCSE: Core Infrastructure

Expert en infrastructures IT avec plus de 15 ans d'expérience sur le terrain. Actuellement Chef de projet Systèmes et Réseaux et Référent SSI (Sécurité des Systèmes d'Information), je mets mon expertise au service de la fiabilité et de la sécurité des environnements technologiques.