Linux Command Cheat Sheet/Add user to supplementary group

Append a user to an extra group.

Section: Users Groups and Sessions

Add user to supplementary group

bash
bash
sudo usermod -aG docker alice
Explanation

Always include `-a` with `-G` to avoid overwriting existing supplementary groups.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Users Groups and Sessions
Change group owner
Set the group of a file or directory.
OpenIn sheetbash1 tag match
Show current user and groups
Display numeric and named identity info.
OpenIn sheetbash1 tag match
Print current username
Show the effective user name.
OpenIn sheetbash1 tag match
Run command as root
Execute a command with elevated privileges.
OpenIn sheetbash1 tag match
Print working directory
Show the current absolute path.
Create file or update timestamp
Create an empty file if it does not exist.