Linux newgrp Command

Linux 命令大全Linux Command Encyclopedia

The Linux newgrp command is used to log into another group.

The newgrp command is similar to the login command. It logs into the system again with the same account but under a different group name. To switch groups using the newgrp command, you must be a user of that group; otherwise, you will not be able to log into the specified group. If a single user needs to belong to multiple groups at the same time, the alternate user setting must be used. If no group name is specified, the newgrp command will log into the default group for that username.

Syntax

newgrp [群组名称]

Examples

Change group

# newgrp root

Linux 命令大全Linux Command Encyclopedia

Other Extensions