list users and groups
See the accounts on this machine, the groups, and who is in each.
userssystem
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.
add a user
Create 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 it
Give a folder, its subfolders and its files the permissions or the owner they need, without making them open to everyone.
count the processors
How many processors and cores this machine has, and what they are.
find what killed a process
A program vanished or says "Killed": usually the kernel ran out of memory and stopped it. Find out.