newgrp
Linux · Users and permissions · reference only
What it does
Changes the current session's primary group to another group you already belong to, opening a new shell.
Syntax
newgrp [-] [grupo]
Options and parameters
grupoGroup to switch to; you must be a member or know its password.
-Resets the environment as in a fresh login.
(sin argumentos)Goes back to the primary group listed in /etc/passwd.
Usage examples
newgrp devsFiles you create from now on will belong to the devs group.
id -gnShows the active primary group to check the change.
newgrpReturns to your account's original primary group.
Notes and common mistakes
- It opens a new shell: leave with exit to return to the previous one.
- It is the way to apply a membership just added with gpasswd without logging out.