In Linux, a "run level" refers to a specific state of the operating system in which a certain set of services and daemons are running. There are several predefined run levels, each with a specific purpose.
Use the runlevel command /sbin/runlevel to find the current and previous runlevel of an operating system.
| Linux Run Level (init 0) | ||
|---|---|---|
| ID | Name | Description |
| 0 | Off | Turns off the device. |
| 1 | Single-user mode | Mode for administrative tasks. |
| 2 | Multi-user mode | Does not configure network interfaces and does not export networks services. |
| 3 | Multi-user mode with networking | Starts the system normally. |
| 4 | Not used/user-definable | For special purposes. |
| 5 | Full mode | Same as runlevel 3+. |
| 6 | Reboot | Reboots the device. |
Use the runlevel command /sbin/runlevel to find the current and previous runlevel of an operating system.
Frequently asked questions
How do I check the current runlevel?
Run
runlevel. It prints the previous and the current runlevel, for example N 5, where N means there was no previous level. who -r shows the same information.How do I change the runlevel?
Run
init <number> as root, for example init 3 for multi-user mode with networking. init 0 shuts the system down and init 6 reboots it.Do runlevels still exist on systemd systems?
systemd uses targets instead: runlevel 3 corresponds to
multi-user.target and runlevel 5 to graphical.target. Use systemctl get-default to see the default and systemctl set-default multi-user.target to change it.What is the difference between runlevel 3 and runlevel 5?
Runlevel 3 is multi-user mode with networking and a text console. Runlevel 5 starts the same services plus the graphical desktop.
Comments
0Please sign in to leave a comment.
No comments yet
Be the first to share your thoughts!