See a file's ownership and permissions with ls -a
$ sudo useradd -m peter
$ sudo passwd peter
$ groupadd myAppUsers
$ sudo usermod -a -G peter myAppUsers
adduser and addgroup are interactive convenience scripts that wrap the useradd and groupadd commands.
$ id
$ id peter
$ groups
$ groups peter
List files, showing permissions and ownership information
ls -l
Permissions are course grained, and set for exactly 3 scopes: owner, groups and others (global)
chmod u=rwx,g=rwx,o=rwx myFile.txt
chmod 777 myFile.txt
TODO: setfacl - for working with ACLs
$ chown peter myFile.txt
$ chgrp myAppUsers myFile.txt
$ sudo commandname
su - switch user