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.
2. When Terminal launches, type in the following command into it and hit Enter:
dscl . list /Users
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.
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 '_'
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.
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
6. You now have all the information you want on your Terminal screen.
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
- Jazz Up Your Mac’s Folders and Apps With Custom Icons
- The Advanced Guide to Making the Most of Spotlight
- How to Delete a User Account on Your Mac
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