Explain some common operations of user and group by bash shell in Ubuntu.
List all the users and groups
List users
~$ less /etc/passwd ~$ more /etc/passwd ~$ cat /etc/passwd
List groups
~$ less /etc/group ~$ more /etc/group ~$ cat /etc/group
Create user and group
Create and remove a group
~$ sudo addgroup~$ sudo delgroup
Create and remove a user
~$ sudo adduserSystem will create a same name group if you notice.
~$ deluserThis user's primary group will be removed at the same time.
Add user to group
~$ sudo adduser
For more details please reference Ubuntu official document: User Management