{
    "content": [
        {
            "type": "text",
            "text": "# newgrp (man)\n\n## NAME\n\nnewgrp - log in to a new group\n\n## SYNOPSIS\n\nnewgrp [-] [group]\n\n## DESCRIPTION\n\nThe newgrp command is used to change the current group ID during a login session. If the\noptional - flag is given, the user's environment will be reinitialized as though the user had\nlogged in, otherwise the current environment, including current working directory, remains\nunchanged.\n\n## TLDR\n\n> Switch primary group membership.\n\n- Change user's primary group membership:\n  `newgrp {{group_name}}`\n- Reset primary group membership to user's default group in `/etc/passwd`:\n  `newgrp`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONFIGURATION** (1 subsections)\n- **FILES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "newgrp",
        "section": "",
        "mode": "man",
        "summary": "newgrp - log in to a new group",
        "synopsis": "newgrp [-] [group]",
        "tldr_summary": "Switch primary group membership.",
        "tldr_examples": [
            {
                "description": "Change user's primary group membership",
                "command": "newgrp {{group_name}}"
            },
            {
                "description": "Reset primary group membership to user's default group in `/etc/passwd`",
                "command": "newgrp"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "id",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/id/1/json"
            },
            {
                "name": "login",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/login/1/json"
            },
            {
                "name": "su",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/su/1/json"
            },
            {
                "name": "sg",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sg/1/json"
            },
            {
                "name": "gpasswd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gpasswd/1/json"
            },
            {
                "name": "group",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/group/5/json"
            },
            {
                "name": "gshadow",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/gshadow/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "SYSLOG___SG___ENAB (boolean)",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "newgrp - log in to a new group\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "newgrp [-] [group]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The newgrp command is used to change the current group ID during a login session. If the\noptional - flag is given, the user's environment will be reinitialized as though the user had\nlogged in, otherwise the current environment, including current working directory, remains\nunchanged.\n\nnewgrp changes the current real group ID to the named group, or to the default group listed\nin /etc/passwd if no group name is given.  newgrp also tries to add the group to the user\ngroupset. If not root, the user will be prompted for a password if she does not have a\npassword (in /etc/shadow if this user has an entry in the shadowed password file, or in\n/etc/passwd otherwise) and the group does, or if the user is not listed as a member and the\ngroup has a password. The user will be denied access if the group password is empty and the\nuser is not listed as a member.\n\nIf there is an entry for this group in /etc/gshadow, then the list of members and the\npassword of this group will be taken from this file, otherwise, the entry in /etc/group is\nconsidered.\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "The following configuration variables in /etc/login.defs change the behavior of this tool:\n",
                "subsections": [
                    {
                        "name": "SYSLOG___SG___ENAB (boolean)",
                        "content": "Enable \"syslog\" logging of sg activity.\n"
                    }
                ]
            },
            "FILES": {
                "content": "/etc/passwd\nUser account information.\n\n/etc/shadow\nSecure user account information.\n\n/etc/group\nGroup account information.\n\n/etc/gshadow\nSecure group account information.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(5).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                    NEWGRP(1)",
                "subsections": []
            }
        }
    }
}