What does each runlevel in Linux do?
"Run Levels" in Linux are different startup or shutdown settings
that can be used at any time to force Linux into a given state
using the "init" command.
Level 0 forces a total system shutdown.
Level 1 switches to "maintanance mode" and only allows the
system administrator to log in. This is about the same as Windows
"safe mode with command prompt".
Levels 2 and 5 can be defined differently, depending on what
version of Linux you are using. Typically, one of these is set to
start the graphical user interface, another to start only the
command line, and so on. The exact results, again, always depends
on what version of Linux is used.
Level 6 forces the system to reboot.
It should be helpful to note that runlevels are not in every
Linux system. Systemd-based setups do not have runlevels. The
closest they have are "targets," though these are not completely
analogous to runlevels.