How to list all users in Mac Terminal

If you want a list of all user account names on the Mac using the Terminal, there are multiple ways to do that.

One of the simplest ways is the do do an ls for the /Users directory. The folders you see within it are literally the users that your Mac has.

% ls /Users 
Shared		c2ctech		dev		guest

Just ignore the Shared folder.

As macOS is a Unix-based OS, you will find that all the users are available under the etc/passwd file.

cat /etc/passwd

If you want to have the list of all users including the system users, run the below command in the Terminal.

% dscl . -list /Users

Get the list of Mac Users using Terminal

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap