{
    "mode": "info",
    "parameter": "groups",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/groups/json",
    "generated": "2026-11-10T10:46:50Z",
    "sections": {
        "File: coreutils.info,  Node: groups invocation,  Next: users invocation,  Prev: whoami invocation,  Up: User information": {
            "content": "",
            "subsections": [
                {
                    "name": "20.4 'groups': Print group names a user is in",
                    "content": "'groups' prints the names of the primary and any supplementary groups\nfor each given USERNAME, or the current process if no names are given."
                }
            ]
        },
        "If more than one name is given, the name of each user is printed before": {
            "content": "the list of that user's groups and the user name is separated from the\ngroup list by a colon.  Synopsis:\n\ngroups [USERNAME]...\n\nThe group lists are equivalent to the output of the command 'id -Gn'.\n\nThe only options are '--help' and '--version'.  *Note Common\noptions::.\n\nPrimary and supplementary groups for a process are normally inherited\nfrom its parent and are usually unchanged since login.  This means that\nif you change the group database after logging in, 'groups' will not\nreflect your changes within your existing login session.  Running\n'groups' with a list of users causes the user and group database to be\nconsulted afresh, and so will give a different result.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}