newgrp(1) — Commands
NAME
newgrp − Changes primary group identification of a shell process
SYNOPSIS
newgrp [−l] [group]
newgrp [−] [group]
The newgrp command changes the primary group identification of the current shell process to group. You remain logged in and the current directory is unchanged, but calculations of access permissions to files are performed with respect to the primary group ID.
DESCRIPTION
If you do not specify group, newgrp changes the group identification back to that specified for the current user in the /etc/passwd file. Only exported environment variables retain their values after you invoke newgrp. Otherwise, variables with a default value are reset to that default.
If a password is required for the specified group, and you are not listed as a member of that group in the group database, you are prompted to enter the correct password for that group. If you are listed as a member of that group, no password is requested. If no password is required for the specified group, only users listed as members of that group can change to that group.
Only a user with superuser authority can change the primary group of the shell process to one to which that user does not belong.
When you invoke the newgrp command from a shell, the shell executes the command without forking a new process. Therefore, the shell you were using when you issued the newgrp command is unavailable after the newgrp command finishes.
FLAGS
−lChanges the login environment to what would be expected if the user logged in again.
−Changes the login environment to that of the new group. (Obsolescent)
NOTES
1.The newgrp command is also a built-in command for csh.
2.There is no convenient way to enter a password into the group database. Use of group passwords is not encouraged because by their very nature they encourage poor security practices.