{
    "content": [
        {
            "type": "text",
            "text": "# runlevel(8) (man)\n\n## TLDR\n\n> SysV runlevel utility.\n\n- Return previous and current SysV runlevel:\n  `runlevel`\n- Display help:\n  `runlevel --help`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** runlevel - Print previous and current SysV runlevel\n\n**Synopsis:** runlevel [options...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --help | — | Print a short help text and exit. |\n\n## See Also\n\n- systemd(1)\n- systemd.target(5)\n- systemctl(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **OVERVIEW** (7 lines) — 1 subsections\n  - Table 1. Mapping between runlevels and systemd targets (14 lines)\n- **DESCRIPTION** (9 lines)\n- **OPTIONS** (2 lines) — 1 subsections\n  - --help (2 lines)\n- **EXIT STATUS** (3 lines)\n- **ENVIRONMENT** (7 lines)\n- **FILES** (3 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\nrunlevel - Print previous and current SysV runlevel\n\n### SYNOPSIS\n\nrunlevel [options...]\n\n### OVERVIEW\n\n\"Runlevels\" are an obsolete way to start and stop groups of services used in SysV init.\nsystemd provides a compatibility layer that maps runlevels to targets, and associated\nbinaries like runlevel. Nevertheless, only one runlevel can be \"active\" at a given time,\nwhile systemd can activate multiple targets concurrently, so the mapping to runlevels is\nconfusing and only approximate. Runlevels should not be used in new code, and are mostly\nuseful as a shorthand way to refer the matching systemd targets in kernel boot parameters.\n\n#### Table 1. Mapping between runlevels and systemd targets\n\n┌─────────┬───────────────────┐\n│Runlevel │ Target            │\n├─────────┼───────────────────┤\n│0        │ poweroff.target   │\n├─────────┼───────────────────┤\n│1        │ rescue.target     │\n├─────────┼───────────────────┤\n│2, 3, 4  │ multi-user.target │\n├─────────┼───────────────────┤\n│5        │ graphical.target  │\n├─────────┼───────────────────┤\n│6        │ reboot.target     │\n└─────────┴───────────────────┘\n\n### DESCRIPTION\n\nrunlevel prints the previous and current SysV runlevel if they are known.\n\nThe two runlevel characters are separated by a single space character. If a runlevel cannot\nbe determined, N is printed instead. If neither can be determined, the word \"unknown\" is\nprinted.\n\nUnless overridden in the environment, this will check the utmp database for recent runlevel\nchanges.\n\n### OPTIONS\n\nThe following option is understood:\n\n#### --help\n\nPrint a short help text and exit.\n\n### EXIT STATUS\n\nIf one or both runlevels could be determined, 0 is returned, a non-zero failure code\notherwise.\n\n### ENVIRONMENT\n\n$RUNLEVEL\nIf $RUNLEVEL is set, runlevel will print this value as current runlevel and ignore utmp.\n\n$PREVLEVEL\nIf $PREVLEVEL is set, runlevel will print this value as previous runlevel and ignore\nutmp.\n\n### FILES\n\n/run/utmp\nThe utmp database runlevel reads the previous and current runlevel from.\n\n### SEE ALSO\n\nsystemd(1), systemd.target(5), systemctl(1)\n\n\n\nsystemd 249                                                                              RUNLEVEL(8)\n\n"
        }
    ],
    "structuredContent": {
        "command": "runlevel",
        "section": "8",
        "mode": "man",
        "summary": "runlevel - Print previous and current SysV runlevel",
        "synopsis": "runlevel [options...]",
        "tldr_summary": "SysV runlevel utility.",
        "tldr_examples": [
            {
                "description": "Return previous and current SysV runlevel",
                "command": "runlevel"
            },
            {
                "description": "Display help",
                "command": "runlevel --help"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Print a short help text and exit."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "systemd.target",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.target/5/json"
            },
            {
                "name": "systemctl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "OVERVIEW",
                "lines": 7,
                "subsections": [
                    {
                        "name": "Table 1. Mapping between runlevels and systemd targets",
                        "lines": 14
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "--help",
                        "lines": 2,
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}