Delete a standard user from Mac OS I created a new Admin account in Sierra High and needed to delete the previous admin account which is marked now as the standard user. However, after unlocking as admin and selecting the respective user that I would like to delete, I see the - sign is marked as Grey. 



This is all accounts and I would like to delete the mac user account, 

$ dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]'
name: mac
password: ********
uid: 501
gid: 20
dir: /Users/mac
shell: /bin/bash
--
--
name: chaklader
password: ********
uid: 502
gid: 20
dir: /Users/chaklader
shell: /bin/bash


How do I delete the respective account? I find a code snippet to run on the terminal, i.e, sudo /usr/bin/dscl . -delete "/Users/mac". Should I try that and will work out?

Update:

As an answer suggested, I'm not logged in to the the fast user switching menu.



As it was asked, I run who in the terminal and get the result, 

$ who

chaklader console  Dec 28 06:01 
chaklader ttys000  Dec 28 14:51


So, in brief the other user, mac was not in the terminal.
The – button is greyed out for a user when the user is still logged in with Fast User Switching. Log out the other user you're trying to delete, then return to System Preferences with this user account and try again. You can restart to be sure that user is inactive as well. 

You can delete a user from command line and you need to be careful you have the exact short name correct or you will erase the wrong data. In this case, the short name is mac. Run the following to delete the user and separately delete the user's home folder. If you want to keep the home folder, don't run the rm command.

sudo dscl . delete /Users/mac
sudo rm -rf /Users/mac


If the dscl command fails, reset the password on the account and retry the above commands.

sudo passwd mac