Determining Your System’s Runlevel
From time to time, you might be unsure just what runlevel your system is in. For example, you may have logged into a Linux system from a remote location and not know how it was booted or maintained. You may also need to know what runlevel your system was in prior to its current runlevel—perhaps wondering if the system was last in single-user mode for maintenance.
To determine this information, use the runlevel command. It displays the
previous and current runlevel as integers, separated by a space, on
standard output. If no runlevel change has occurred since the system
was booted, the previous runlevel is displayed as the letter
N. For a system that was in runlevel 3 and
is now in runlevel 5, the output is:
For a system with a default runlevel of 5 that has just completed booting, the output would be:
runlevel does not alter the system runlevel. To do this, use the init command (or the historical alias telinit).