Users
The usermod command
Modifies a user account: groups, shell, home directory, account lock, and more.
Syntax
sudo usermod [-aG grupos] usuarioMost useful options
-aGAdds to groups without removing current ones-sChanges the shell-LLocks the account-UUnlocks the accountCopy-ready examples
$ sudo groupadd equipo && sudo usermod -aG equipo alumno && groups alumnoAdd to a groupYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Without -a, -G replaces all secondary groups: always use -aG.
FAQ
Why do I not see the new group in my session?
Groups apply at login; log back in or use newgrp.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course