User maintenance on macOS


List all User Accounts

~ % /usr/bin/dscl . -list /Users

will return an output as:

_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
accadmin
daemon
nobody
radu.parvu
root
testfinder

Show a User Account Information

$ /usr/bin/dscl . -read /Users/<USER_ACCOUNT>

So, the command:

bash-3.2$ /usr/bin/dscl . -read /Users/testfinder

will return:

NFSHomeDirectory: /Users/testfinder
Password:
Picture:
/Library/User Pictures/Fun/Yin-Yang.heic
PrimaryGroupID: 20
RealName:
Test Finder
RecordName: testfinder
RecordType: dsRecTypeStandard:Users
UniqueID: 503
UserShell: /bin/zsh
bash-3.2$

Follow the command to Delete a User Account

$ sudo /usr/bin/dscl . -delete /Users/<USER_ACCOUNT>

bash-3.2$ sudo /usr/bin/dscl . -delete /Users/testfinder


Discover more from Radu Pârvu

Subscribe to get the latest posts sent to your email.

, ,

Leave a Reply

Discover more from Radu Pârvu

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Radu Pârvu

Subscribe now to keep reading and get access to the full archive.

Continue reading