Users

The newgrp command

Changes the effective group of the current session without logging out.

Syntax

newgrp grupo

Copy-ready examples

$ sudo groupadd equipo && newgrp equipo && groupsSwitch the active group

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • It opens a subshell: to return to the previous group use exit.

Related commands

FAQ

Why is usermod not enough?

Because new groups only apply at login; newgrp activates them immediately.

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