logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

newgrp - log in to a new group

Authors

       Originally by Michael Haardt. Currently maintained by Peter Orbaek <poe@daimi.aau.dk>.

Availability

       The newgrp command is part of the util-linux package which can be downloaded from Linux Kernel Archive
       <https://www.kernel.org/pub/linux/utils/util-linux/>.

util-linux 2.40.2                                  2025-06-05                                          NEWGRP(1)

Description

newgrp changes the group identification of its caller, analogously to login(1). The same person remains
       logged in, and the current directory is unchanged, but calculations of access permissions to files are
       performed with respect to the new group ID.

       If no group is specified, the GID is changed to the login GID.

       An optional command can be specified, which is invoked after group change instead of the user’s shell.

Files

/etc/group, /etc/passwd

Name

       newgrp - log in to a new group

Options

-c, --command=command
           Pass command to the user’s shell with the -c option.

       -h, --help
           Display help text and exit.

       -V, --version
           Print version and exit.

Reporting Bugs

       For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.

See Also

login(1), group(5)

Synopsis

newgrp [group [command]]

       newgrp [-ccommand] [group]

See Also