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!
More Posts related to MacOS,
- How to Display Analog Clock on Mac Menu Bar
- Shutdown Mac Terminal Command
- How to know the Serial Number of MacBook on macOS Ventura 13.0
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing
- [fix] How to Show file extensions on all files on Mac
- How to install Zoom Add-in to Outlook (Mac)
- How to turn off Stage Manager - macOS Ventura
- Fix - Xode - Internal logic error: Connection was invalidated
- How to do calculations in Mac Terminal
- How to delete a Page in Microsoft Word File on Mac (macOS)
- How to Refresh Mac Desktop
- How to install Java on macOS [Big Sur]
- How to Disable Mac Terminal Bell Sound
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to Uninstall Brew on Mac
- Find your macOS version
- Change TextEdit File Encoding
- AppleScript Example with TextEdit
- How to install homebrew (brew) on M1 Mac
- How to Find File and Directory Size in Mac Terminal
- How to open new tab in Sublime Text Editor [macOS]
- How to list all users in Mac Terminal
- Turn off Auto-Capitalization on macOS Ventura 13
- How to check Command Line Tools Version [Updated for Ventura]
- Change Current User Password using Mac Terminal Command
More Posts:
- Remove items from JavaScript array - JavaScript
- Power of Print Statements in JavaScript: A Comprehensive Guide - JavaScript
- PowerShell: The term Connect-AzureAD is not recognized as the name of a cmdlet - Powershell
- Create Symbolic Link using Terminal Command - MacOS
- Queue Implementation in Java with Examples - Java
- Python: Access index/counter of a for loop iteration - Python
- 3 ways to clear screen on Linux Terminal - Linux
- Ezoic: My Honest Review after 100 Days of Use - Maximizing Revenue with a Personal Touch - 2022