Linux users and groups

Groups

List all groups
cat /etc/group
Create new group

https://linux.die.net/man/8/groupadd

groupadd mygroup

Use -f to exit successfully if the group already exists.

Users

List all users
cat /etc/passwd
Create new user
useradd -g GROUP -d HOMEDIR USERNAME

Will fail if GROUP does not exist yet.

echo ~username
id -u tomcat
find / -user tomcat -print
Delete a user and the user’s home directory
userdel -r tomcat"