NEWGRP(1)

NAME
newgrp - change to a new primary group

SYNOPSIS

newgrp [-l] [group] [command [args...]]

DESCRIPTION

newgrp starts a new shell environment under a new primary group.

If the -l flag is given as first argument, the user's environment will be reinitialized as though the user had logged in, otherwise the current environment, including current working directory, remains unchanged. For Linux compatibility, the flag - is allowed as well.

newgrp changes the current primary group to the named group, or to the default group listed in /etc/passwd if no group name is given. The user's standard shell is started, called as login shell if the -l or - flag has been specified.

The group argument can be specified as group name from the group database or a non-negative numeric group ID.

If a group has been given as argument, a command and its arguments can be specified on the command line. Note that this usage is Cygwin-only and incompatible with POSIX and Linux.

The new primary group must be either the old primary group, or it must be part of the supplementary group list. Setting the primary group to an arbitrary group is not allowed in Windows.

SEE ALSO

id(1), login(1).

COPYRIGHT

Copyright © Cygwin authors

Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.