newgrp
changes the current real group ID to the specified group
TLDR
SYNOPSIS
newgrp [-] [group]
DESCRIPTION
newgrp changes the current real group ID to the specified group and also tries to add the group to the user groupset. If a hyphen is provided, the environment is reinitialized as a login shell. Files created after running newgrp will have the new group as their group owner.If not root, the user will be prompted for a password if the user does not have a password and the group does, or if the user is not listed as a member and the group has a password. The user will be denied access if the group password is empty and the user is not listed as a member. If no group is specified, the group is changed to the default group listed in /etc/passwd.
PARAMETERS
-
Reinitialize the environment as if the user had logged ingroup
Group name to switch to; must be a member or know group password
CAVEATS
This starts a new shell with the changed group. The original shell's group remains unchanged. Group passwords are rarely used and considered insecure. The change only affects the new shell and its children.
HISTORY
newgrp is a standard POSIX command that has been part of Unix systems since early versions. It provides a way to temporarily switch group context without logging out and back in.
