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
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
_accessoryupdater
_amavisd
_analyticsd
_appinstalld
_appleevents
_applepay
_appowner
_appserver
_appstore
_ard
_assetcache
_astris
_atsserver
_audiomxd
_avbdeviced
_avphidbridge
_backgroundassets
_biome
_calendar
_captiveagent
_ces
_clamav
_cmiodalassistants
_coreaudiod
_coremediaiod
_coreml
_ctkd
_cvmsroot
_cvs
_cyrus
_darwindaemon
_datadetectors
_demod
_devdocs
_devicemgr
_diskimagesiod
_displaypolicyd
_distnote
_dovecot
_dovenull
_dpaudio
_driverkit
_eppc
_findmydevice
_fpsd
_ftp
_gamecontrollerd
_geod
_hidd
_iconservices
_installassistant
_installcoordinationd
_installer
_jabber
_kadmin_admin
_kadmin_changepw
_knowledgegraphd
_krb_anonymous
_krb_changepw
_krb_kadmin
_krb_kerberos
_krb_krbtgt
_krbfast
_krbtgt
_launchservicesd
_lda
_locationd
_logd
_lp
_mailman
_mbsetupuser
_mcxalr
_mdnsresponder
_mmaintenanced
_mobileasset
_mobilegestalthelper
_mysql
_nearbyd
_netbios
_netstatistics
_networkd
_neuralengine
_notification_proxy
_nsurlsessiond
_oahd
_ondemand
_postfix
_postgres
_qtss
_reportmemoryexception
_rmd
_sandbox
_screensaver
_scsd
_securityagent
_sntpd
_softwareupdate
_spotlight
_sshd
_svn
_taskgated
_teamsserver
_terminusd
_timed
_timezone
_tokend
_trustd
_trustevaluationagent
_unknown
_update_sharing
_usbmuxd
_uucp
_warmd
_webauthserver
_windowserver
_www
_wwwproxy
_xserverdocs
c2ctechtv
daemon
nobody
root
Facing issues? Have Questions? Post them here! I am happy to answer!
- How to list all users in Mac Terminal
- Docker Desktop needs privileged access macOS
- Mac: How to show count of files and folders in Finder
- How to Change Background Color TextEdit on Mac
- How to adjust MacBook Desktop icons size
- Test internet speed using macOS Terminal command
- How to change the default font and text size in Microsoft Excel for Mac
- How to install Java on macOS [Big Sur]
- How to come out of dquote prompt in Terminal - macOS/Linux
- How to Increase MacBook Trackpad Cursor Speed on macOS Ventura/Sonoma
- Fix: Microsoft Excel Quit Unexpectedly on Mac
- How to Adjust macOS System Font Size
- How to Quit Applications on Mac Using Terminal
- How to check zsh installed version using terminal
- Two Ways to Extract rar (*.rar) files on Mac
- How to Right Click on Mac Desktop?
- How to Add Brew to PATH M1/M2 Mac
- How to search (find) in macOS Terminal Console Text
- macOS 13 Ventura - The New About this Mac Window
- TextEdit Get the count of lines in a file
- How to run .sh file in Mac Terminal
- Google Search Hot Trends Screensaver for Mac OS X
- Check Reboot History Mac
- [Solution] Mac Update Stuck Preparing macOS Ventura 13.0 About 30 minutes remaining
- Display Safari URL address link on hover
- Fix - bash: man: command not found - Linux
- The Android Virtual Device is currently running in an emulator and cannot be deleted - Android
- [Android] RuntimeException: Unable to start activity Need BLUETOOTH permission - Android
- Change the default git branch name from master to main - Git
- Know the version of Microsoft Excel on Mac - Microsoft
- Python ternary operator (known as Conditional Expression) Example - Python
- How to Change Android Toast Position? - Android
- [git] fatal: your current branch 'main' does not have any commits yet - Git