newgrp

change to a new group (POSIX)

Syntax:

newgrp [-|-l|-s] [group]

Options:

-
Deprecated. Synonymous to -l.
-l
("el") Change the environment to what would be expected if the user actually logged in again.
-s
Set the groupid of the parent, do not exec() a login shell.
group
A groupid name.

Description:

The newgrp utility starts a new shell with a new real and effective groupid. The user remains logged in and the current directory doesn't change, but file access permissions are based on the new real and effective groupids.

If no operands are specified, newgrp changes the groupid back to the group identified in the invoking user's entry in /etc/passwd.

If you don't use the -l option, the environment variables remain unchanged.

Note that group passwords aren't supported in QNX. Only the superuser (userid 0) may change the groupid to a group that the user doesn't belong to.

Files:

/etc/group
Contains information on the groupids in the system. See passwd's "Files" section for a brief description of the format of this file.
/etc/passwd
Contains information on the userids in the system.

See the passwd utility "Files" section for a brief description of the format of these files.

See also: