List Linux users via the shell

If you have a need to find the user accounts present on a Linux computer via the shell the below command should help.

cat /etc/passwd | grep "/home" | cut -d: -f1

This will list all users on the computer that have a home directory, you could also run  the below to get more information and all kinds of system accounts.

cat /etc/passwd

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.