{
    "content": [
        {
            "type": "text",
            "text": "# mcookie (man)\n\n## NAME\n\nmcookie - generate magic cookies for xauth\n\n## SYNOPSIS\n\nmcookie [options]\n\n## DESCRIPTION\n\nmcookie generates a 128-bit random hexadecimal number for use with the X authority system.\nTypical usage:\n\n## TLDR\n\n> Generate random 128-bit hexadecimal numbers.\n\n- Generate a random number:\n  `mcookie`\n- Generate a random number, using the contents of a file as a seed for the randomness:\n  `mcookie {{-f|--file}} {{path/to/file}}`\n- Generate a random number, using a specific number of bytes from a file as a seed for the randomness:\n  `mcookie {{-f|--file}} {{path/to/file}} {{-m|--max-size}} {{number_of_bytes}}`\n- Print the details of the randomness used, such as the origin and seed for each source:\n  `mcookie {{-v|--verbose}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (5 subsections)\n- **FILES**\n- **BUGS**\n- **SEE ALSO**\n- **REPORTING BUGS**\n- **AVAILABILITY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "mcookie",
        "section": "",
        "mode": "man",
        "summary": "mcookie - generate magic cookies for xauth",
        "synopsis": "mcookie [options]",
        "tldr_summary": "Generate random 128-bit hexadecimal numbers.",
        "tldr_examples": [
            {
                "description": "Generate a random number",
                "command": "mcookie"
            },
            {
                "description": "Generate a random number, using the contents of a file as a seed for the randomness",
                "command": "mcookie {{-f|--file}} {{path/to/file}}"
            },
            {
                "description": "Generate a random number, using a specific number of bytes from a file as a seed for the randomness",
                "command": "mcookie {{-f|--file}} {{path/to/file}} {{-m|--max-size}} {{number_of_bytes}}"
            },
            {
                "description": "Print the details of the randomness used, such as the origin and seed for each source",
                "command": "mcookie {{-v|--verbose}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-f",
                "long": "--file",
                "arg": null,
                "description": "Use this file as an additional source of randomness (for example /dev/urandom). When file is '-', characters are read from standard input."
            },
            {
                "flag": "-m",
                "long": "--max-size",
                "arg": null,
                "description": "Read from file only this number of bytes. This option is meant to be used when reading additional randomness from a file or device. The number argument may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the \"iB\" is optional, e.g., \"K\" has the same meaning as \"KiB\") or the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Inform where randomness originated, with amount of entropy read from each source."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "md5sum",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/md5sum/1/json"
            },
            {
                "name": "X",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/X/7/json"
            },
            {
                "name": "xauth",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/xauth/1/json"
            },
            {
                "name": "rand",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/rand/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-f --file",
                        "lines": 3,
                        "flag": "-f",
                        "long": "--file"
                    },
                    {
                        "name": "-m --max-size",
                        "lines": 8,
                        "flag": "-m",
                        "long": "--max-size"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mcookie - generate magic cookies for xauth\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "mcookie [options]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "mcookie generates a 128-bit random hexadecimal number for use with the X authority system.\nTypical usage:\n\nxauth add :0 . mcookie\n\nThe \"random\" number generated is actually the MD5 message digest of random information coming\nfrom one of the sources getrandom(2) system call, /dev/urandom, /dev/random, or the libc\npseudo-random functions, in this preference order. See also the option --file.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-f --file",
                        "content": "Use this file as an additional source of randomness (for example /dev/urandom). When file\nis '-', characters are read from standard input.\n",
                        "flag": "-f",
                        "long": "--file"
                    },
                    {
                        "name": "-m --max-size",
                        "content": "Read from file only this number of bytes. This option is meant to be used when reading\nadditional randomness from a file or device.\n\nThe number argument may be followed by the multiplicative suffixes KiB=1024,\nMiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the \"iB\" is optional, e.g.,\n\"K\" has the same meaning as \"KiB\") or the suffixes KB=1000, MB=1000*1000, and so on for\nGB, TB, PB, EB, ZB and YB.\n",
                        "flag": "-m",
                        "long": "--max-size"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "Inform where randomness originated, with amount of entropy read from each source.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "content": "Display version information and exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help text and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            "FILES": {
                "content": "/dev/urandom\n\n/dev/random\n",
                "subsections": []
            },
            "BUGS": {
                "content": "It is assumed that none of the randomness sources will block.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "md5sum(1), X(7), xauth(1), rand(3)\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "The mcookie command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-06-02                                   MCOOKIE(1)",
                "subsections": []
            }
        }
    }
}