How to List User Accounts Using Terminal on Your Mac

You can reach the user accounts on a Mac via the System Preferences panel, found by clicking on the Apple logo located at the top-left of your screen. Nonetheless, there might be instances where you need to comprehensively list the users on your Mac within a Terminal window. Several reasons might necessitate such action and if you ever find yourself in that situation, this is the correct procedure for you.

Terminal does have a command that lets you access the list of the users on your Mac. By executing the command, youโ€™re presenting yourself to all the users that hold an account on your machine. Not only is this account limited to showing regular users, but itโ€™ll also show the system accounts that you normally donโ€™t have access to. Your Mac automatically creates this system accounts for its own use and it doesnโ€™t let you interfere with them.

Read also: How to Remove a User Account on Your Mac

So, hereโ€™s how you can go about finding out all the user accounts on your Mac using a command:

Listing the User Accounts using Terminal on Your Mac

1. Launch Terminal on your Mac. You can either use Spotlight or the Launchpad to find and launch the app.

Listing the User Accounts

2. When Terminal launches, type in the following command into it and hit Enter:

dscl . list /Users

Listing the User Accounts

3. As soon as the commandโ€™s executed, you should see all of the users that exist on your system. Youโ€™ll notice that thereโ€™re a number of accounts in the list that you havenโ€™t created yourself. Those are actually processes and other system stuff.

Listing the User Accounts

If youโ€™d like to only see the actual user accounts as most end-users would, you can exclude the other accounts from showing up in the list using the following command:

dscl . list /Users | grep -v '_'

Listing the User Accounts

4. Youโ€™ll now only see the user accounts on your screen and not any other stuff. You will, however, find some accounts that arenโ€™t yours, but those have been created for some tasks by the OS.

Listing the User Accounts

5. Not only does Terminal let you see all user accounts, but it also shows you other information about those accounts as well. This contains the userโ€™s directories, and so on.

To access that, enter the following command into Terminal and press Enter.

dscacheutil -q user

Listing the User Accounts 4

6. You now have all the information you want on your Terminal screen.

Listing the User Accounts

So, thatโ€™s how you can access the list of all the user accounts on a Mac using a simple command in Terminal.

While you may not always want to use the command only to list users, itโ€™s definitely a great thing to get a list of all the user accounts with a simple command. And as youโ€™ve seen, it lets you see all those hidden accounts that the OS has created on your machine. You wouldโ€™ve never seen them had you not used the Terminal app.

Terminal also lets you make changes to these user accounts, but thatโ€™s out of the scope of this article. Itโ€™s possible, though.

Let us know if this helped you reveal all the accounts on your Mac!

Read more like this

4/5 - (4 votes)

1 Comment
  1. Thank you so much. I’ve just gotten my first look at what in the world is on the Terminal. I don’t know what it all means yet but it sure is interesting. I took courses from very knowlegeable people years ago and have never gotten past the former owner’s name on my reused computer although trying to get started numerous times over the years. Thank you again. Lee

Leave a reply

Tutorials Related To Windows, Mac, iOS & Android - OMGHowTo.Com
Logo