{
    "mode": "man",
    "parameter": "id",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/id/1/json",
    "generated": "2026-06-02T20:22:10Z",
    "synopsis": "id [OPTION]... [USER]...",
    "sections": {
        "NAME": {
            "content": "id - print real and effective user and group IDs\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "id [OPTION]... [USER]...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Print user and group information for each specified USER, or (when USER omitted) for the cur‐\nrent user.\n",
            "subsections": [
                {
                    "name": "-a",
                    "content": "",
                    "flag": "-a"
                },
                {
                    "name": "-Z --context",
                    "content": "print only the security context of the process\n",
                    "flag": "-Z",
                    "long": "--context"
                },
                {
                    "name": "-g --group",
                    "content": "print only the effective group ID\n",
                    "flag": "-g",
                    "long": "--group"
                },
                {
                    "name": "-G --groups",
                    "content": "print all group IDs\n",
                    "flag": "-G",
                    "long": "--groups"
                },
                {
                    "name": "-n --name",
                    "content": "print a name instead of a number, for -ugG\n",
                    "flag": "-n",
                    "long": "--name"
                },
                {
                    "name": "-r --real",
                    "content": "print the real ID instead of the effective ID, with -ugG\n",
                    "flag": "-r",
                    "long": "--real"
                },
                {
                    "name": "-u --user",
                    "content": "print only the effective user ID\n",
                    "flag": "-u",
                    "long": "--user"
                },
                {
                    "name": "-z --zero",
                    "content": "delimit entries with NUL characters, not whitespace;\n\nnot permitted in default format\n\n--help display this help and exit\n",
                    "flag": "-z",
                    "long": "--zero"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nWithout any OPTION, print some useful set of identified information.\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Arnold Robbins and David MacKenzie.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Full documentation <https://www.gnu.org/software/coreutils/id>\nor available locally via: info '(coreutils) id invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                       ID(1)",
            "subsections": []
        }
    },
    "summary": "id - print real and effective user and group IDs",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-Z",
            "long": "--context",
            "arg": null,
            "description": "print only the security context of the process"
        },
        {
            "flag": "-g",
            "long": "--group",
            "arg": null,
            "description": "print only the effective group ID"
        },
        {
            "flag": "-G",
            "long": "--groups",
            "arg": null,
            "description": "print all group IDs"
        },
        {
            "flag": "-n",
            "long": "--name",
            "arg": null,
            "description": "print a name instead of a number, for -ugG"
        },
        {
            "flag": "-r",
            "long": "--real",
            "arg": null,
            "description": "print the real ID instead of the effective ID, with -ugG"
        },
        {
            "flag": "-u",
            "long": "--user",
            "arg": null,
            "description": "print only the effective user ID"
        },
        {
            "flag": "-z",
            "long": "--zero",
            "arg": null,
            "description": "delimit entries with NUL characters, not whitespace; not permitted in default format --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit Without any OPTION, print some useful set of identified information."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Display current user and group identity.",
        "examples": [
            {
                "description": "Display current user's ID (UID), group ID (GID), and groups to which they belong",
                "command": "id"
            },
            {
                "description": "Display the current user identity",
                "command": "id {{-un|--user --name}}"
            },
            {
                "description": "Display the current user identity as a number",
                "command": "id {{-u|--user}}"
            },
            {
                "description": "Display the current primary group identity",
                "command": "id {{-gn|--group --name}}"
            },
            {
                "description": "Display the current primary group identity as a number",
                "command": "id {{-g|--group}}"
            },
            {
                "description": "Display all groups the current user belongs to",
                "command": "id {{-Gn|--groups --name}}"
            },
            {
                "description": "Display an arbitrary user's ID (UID), group ID (GID), and groups to which they belong",
                "command": "id {{username}}"
            },
            {
                "description": "Skip name lookup and specify the UID number explicitly",
                "command": "id +{{uid_number}}"
            }
        ]
    }
}