list users and groups
See the accounts on this machine, the groups, and who is in each.
Steps
-
getent passwd | cut -d: -f1every account's name
-
getent passwd | awk -F: '$3 >= 1000 {print $1}'the people, not the system accounts (Linux)
-
getent groupevery group and its members
-
groups NAMEthe groups of one user
-
idyour own user, groups and numbers
-
dscl . list /UsersmacOS
Commands used
getentgroupsid
Each has a page in lore: lore getent opens it.
Related recipes
- add a userCreate an account with a home folder and a password, and let it use sudo if it should.
- change permissions of a folder and everything in itGive a folder, its subfolders and its files the permissions or the owner they need, without making them open to everyone.
- count the processorsHow many processors and cores this machine has, and what they are.
- find what killed a processA program vanished or says "Killed": usually the kernel ran out of memory and stopped it. Find out.