{
    "content": [
        {
            "type": "text",
            "text": "# runlevel (man)\n\n## NAME\n\nrunlevel - Print previous and current SysV runlevel\n\n## SYNOPSIS\n\nrunlevel [options...]\n\n## DESCRIPTION\n\nrunlevel prints the previous and current SysV runlevel if they are known.\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## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **OVERVIEW** (1 subsections)\n- **DESCRIPTION**\n- **OPTIONS** (1 subsections)\n- **EXIT STATUS**\n- **ENVIRONMENT**\n- **FILES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "runlevel",
        "section": "",
        "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": 15
                    }
                ]
            },
            {
                "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": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "runlevel - Print previous and current SysV runlevel\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "runlevel [options...]\n",
                "subsections": []
            },
            "OVERVIEW": {
                "content": "\"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",
                "subsections": [
                    {
                        "name": "Table 1. Mapping between runlevels and systemd targets",
                        "content": "┌──────────┬───────────────────┐\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": {
                "content": "runlevel 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",
                "subsections": []
            },
            "OPTIONS": {
                "content": "The following option is understood:\n",
                "subsections": [
                    {
                        "name": "--help",
                        "content": "Print a short help text and exit.\n",
                        "long": "--help"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "If one or both runlevels could be determined, 0 is returned, a non-zero failure code\notherwise.\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "$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",
                "subsections": []
            },
            "FILES": {
                "content": "/run/utmp\nThe utmp database runlevel reads the previous and current runlevel from.\n\nAdded in version 237.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "systemd(1), systemd.target(5), systemctl(1)\n\nsystemd 255                                                                              RUNLEVEL(8)",
                "subsections": []
            }
        }
    }
}