Linux Command - newgrp
The Linux command newgrp can be used to change the primary group membership of a user for a session.
- Need to be a member of the group or have the password for that group.
Change primary group membership to this group:
newgrp group1
Reinitialize env as if user just logged in ( using a dash ):
newgrp - group1
Reset primary group to users default group:
newgrp