MacOS – How to list all user accounts in the terminal

command linemacosterminal

How can I list all local user accounts in Terminal (whether logged in or not?) The commands users or who does not provide this information. OS X version is 10.6.8.

I have seen this suggested command – dscacheutil -q group

But it only lists domain user groups and non-local accounts.

Best Answer

How about

dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]'