4iT IT Support Sydney | Your Reliable Sydney IT Support Partner

Knowledge Base

How to List User Accounts on macOS Using Terminal

To list user accounts on macOS from Terminal, run dscl . list /Users. That returns every account on the machine, including the hidden system accounts macOS uses internally. To see only the real human accounts, filter out the ones whose names start with an underscore: dscl . list /Users | grep -v '^_'.

Mac computer on a desk with a terminal window open

Key facts

  • dscl . list /Users lists all user accounts on the local Mac.
  • System and service accounts have names beginning with an underscore, such as `_spotlight` and `_mbsetupuser`.
  • Real user accounts almost always have a user ID (UID) of 501 or higher.
  • dscacheutil -q user returns full account records, including UID, home directory, and shell.
  • These commands read the local directory; they do not require sudo to list accounts.

How do you list only real user accounts?

The cleanest way to list only the human accounts is to filter on the UID, because macOS assigns standard user accounts a UID of 501 and up while reserving lower numbers for system accounts. This one-liner prints the real accounts and their UIDs:

dscl . list /Users UniqueID | awk '$2 >= 501 {print $1}'

If you just want names and do not care about IDs, the underscore filter is quicker: dscl . list /Users | grep -v '^_'. It still leaves a couple of built-in entries like `root`, `daemon`, and `nobody`, so the UID method is the more precise of the two.

How do you see details about a specific account?

Use dscacheutil -q user -a name username to pull a single account’s full record. It returns the username, UID, group ID, home directory, and login shell in a readable block, which is handy when you are checking whether an account is set up correctly or troubleshooting a login problem. For a quick read of just one attribute, dscl . read /Users/username followed by the attribute name (for example `NFSHomeDirectory`) works well.

Why use Terminal instead of System Settings?

Terminal shows you every account, not just the ones macOS chooses to display in System Settings. The graphical Users and Groups pane hides system accounts and sometimes hides accounts created by management tools or scripts, which is exactly when you most need to see them. For anyone managing a fleet of Macs, the command line is also scriptable, so you can audit accounts across many machines at once rather than clicking through each one. (We lean on this constantly when auditing client Macs.)

Frequently asked questions

What is the difference between dscl and dscacheutil?

Both read macOS directory data, but they serve different purposes. dscl browses and edits the directory structure directly, which makes it good for listing and reading specific attributes. dscacheutil queries the directory service cache and returns complete, formatted account records, which makes it better for viewing a full account at a glance.

Do I need administrator rights to list user accounts?

No. Listing accounts with dscl . list /Users or dscacheutil is a read-only operation that any logged-in user can run. You only need elevated rights (sudo) if you intend to create, modify, or delete accounts.

Why do some accounts start with an underscore?

The underscore prefix marks system and service accounts that macOS uses to run background processes under restricted permissions. They are not human logins and you should not modify or remove them. Filtering them out is the normal way to get a clean list of real users.

4iT supplies and manages Mac devices for Sydney businesses, including account setup and fleet management. If your Macs need a tidier hand than the built-in tools give you, happy to take a look.

Brett Muscio

About the author

Brett Muscio is the Director of 4iT Support Pty Ltd, a managed services provider based in Castle Hill, NSW. He works with SME clients across Sydney, Melbourne, and Brisbane on Microsoft 365, cybersecurity, networking, and managed Mac and Windows fleets, with on-site support across the Sydney metro area and remote delivery nationally. Connect on LinkedIn.

Scroll to Top