12/11/2016 - 3:41 AM



list User users;

cat etc/passwd

cut -d: -f1 /etc/passwd

list all users;

dscl . list /Users | grep -v '^_'

list all users;

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

add user;

adduser bravo

add user (to sudo group, assign bash, and create home folder);

useradd elasticsearch -s /bin/bash -g sudo -m

add user to sudo group;

gpasswd -a bravo sudo

add group;


delete user;

userdel userName

delete user and home directory;

userdel -r userName

force delete user;

userdel -f userName

remove user from group;

deluser userName groupName

change password (may need to use sudo -s or su -l);


change permissions of current user;

chown $USER -R

change permissions of user and group;

sudo chown -R userName:userGroup -R /path/to/folder