A run level is a state of init and the whole system defines what system services are operating. Run levels are identified by numbers. Runlevel is a mode or state in which a Linux system operates. It has a crucial role in the management of the Linux System.
- Whenever a LINUX system boot, firstly the init process is started which is actually responsible for running other start scripts which mainly involves initialization of your hardware, bringing up the network, and starting the graphical interface.
- Now, the init first finds the default runlevel of the system so that it can run the start scripts corresponding to the default run level.
- A runlevel can simply be thought of as the state your system enters like if a system is in a single-user mode it will have a runlevel 1 while if the system is in a multi-user mode, it will have a runlevel 5.
- A runlevel, in other words, can be defined as a preset single-digit integer for defining the operating state of your LINUX or UNIX-based operating system. Each runlevel designates a different system configuration and allows access to different combinations of processes.
The important thing to note here is that there are differences in the runlevels according to the operating system. The standard LINUX kernel supports these seven different runlevels :
| Runlevel |
Description |
| 0 |
System halt i.e., the system can be safely powered off with no activity. |
| 1 |
Single user mode. |
| 2 |
Multiple user mode with no NFS (network file system). |
| 3 |
Multiple user modes under the command line interface and not under the graphical user interface. |
| 4 |
User-definable. |
| 5 |
Multiple user mode under GUI (graphical user interface) and this is the standard runlevel for most of the LINUX-based systems. |
| 6 |
Reboot which is used to restart the system. |
How to check Runlevel of our Linux system
We will discuss two easy ways to check runlevel in our linux system.
1) Using `runlevel` command
runlevel
This command will show what runlevel we are.

runlevel
2) Using `who` command
who -r
By default, most of the LINUX-based system boots to runlevel 3 or runlevel 5. In addition to the standard runlevels, users can modify the preset runlevels or even create new ones according to the requirement. Runlevels 2 and 4 are used for user-defined runlevels and runlevel 0 and 6 are used for halting and rebooting the system. Obviously, the start scripts for each run level will be different performing different tasks. These start scripts corresponding to each run level can be found in special files present under rc subdirectories. At /etc/rc.d directory there will be either a set of files named rc.0, rc.1, rc.2, rc.3, rc.4, rc.5, and rc.6, or a set of directories named rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d, and rc6.d. For example, run level 1 will have its start script either in file /etc/rc.d/rc.1 or any files in the directory /etc/rc.d/rc1.d.
How to Change the Runlevel in Linux
init is the program responsible for altering the run level which can be called using the telinit command.
For example: To change the system to runlevel 3, you would use the following command:
sudo init 3
This command will stop all non-essential services and processes and start all essential services and processes required for a basic system operation, including networking services.
For example: To change a runlevel from 3 to runlevel 5 which will actually allow the GUI to be started in multi-user mode the telinit command can be used as:
sudo telinit 5
To set the default runlevel for your Linux system
Before in older version of Linux we used to modify the file “/etc/inittab” but in modern versions of Linux such as RHEL 9 and Ubuntu (starting from Ubuntu 15.04) use systemd as the init system instead of the traditional System V init. Therefore, the /etc/inittab file is no longer used.
Now we use `systemctl` command to ser default value of runlevel.
For Example: If we want to make our default runlevel 5 (Which is used as the graphical multi-user mode with networking), we can use the following command.
sudo systemctl set-default graphical.target
For Example: If we want to make our default runlevel (Which is used as the multi-user mode without a graphical interface), we can use the following command.
sudo systemctl set-default multi-user. Target
Frequently Asked Question
Can I create my own custom runlevel in Linux?
Yes, it is possible to create our own custom runlevel by defining the necessary services and processes to be started or stopped in that runlevel but to do so user should have Indepth and advanced knowledge in Linux System Administration.
What is the difference between runlevel 3 and runlevel 5?
Runlevel 5 and 3 are similar in functionality but the key difference is that runlevel 5 supports the graphical user interface (GUI) login prompt whereas runlevel 3 does not have graphical user interface (GUI) but both have multi-user mode with networking, where all essential services and processes required for a basic system operation, including networking services, are started.
What is the purpose of the single-user mode or maintenance mode (Runlevel 1)?
Runlevel 1 is also known as single-user mode or maintenance mode which is used for system maintance and repair. In this mode all other services and processes are stopped, only essential services and processes are started.
Can I switch between runlevels without rebooting the system?
Yes, we can do that by using `init` command with the appropriate runlevel number.
For Example: If we want to change to runlevel 3
sudo init 3
Conclusion
In this article we have discussed ways to change or runlevel of our linux system. We have discussed two ways, runtime and Default changing. We have also discussed that Linux systems typically have seven runlevels, ranging from 0 to 6, and each runlevel corresponds to a specific set of services and processes that are started or stopped when the system enters that runlevel. Overall, by understanding this article anyone can effectively manage and maintain their Linux system.
Similar Reads
How to Run a File in Linux
The command line is one of the most powerful tools in Linux. It allows you to execute commands, manage files, and automate tasks all from a single terminal window. One common task you'll often need to do is run a file, whether itâs a script, a compiled program, or even a text file. In this article,
6 min read
How to Run a File in Linux
The command line is one of the most powerful tools in Linux. It allows you to execute commands, manage files, and automate tasks all from a single terminal window. One common task you'll often need to do is run a file, whether itâs a script, a compiled program, or even a text file. In this article,
6 min read
Linux Kernel
Linux Kernel is the heart of Linux operating systems. It is an open-source (source code that can be used by anyone freely) software that is most popular and widely used in the industry as well as on a personal use basis. Who created Linux and why? Linux was created by Linus Torvalds in 1991 as a hob
4 min read
What Is Linux
The Linux opeÂrating system is a collection of open-source software programs designed to function similarly to Unix systeÂms. Linus Torvalds, a Finnish software engineeÂr, initially launched the Linux kerneÂl, which serves as the core component, on SeptembeÂr 17, 1991. This kernel acts as a vital
12 min read
How to Check Kernel Version in Linux
The kernel is the core component of the Linux operating system, responsible for managing hardware, running processes, and ensuring system stability. Whether you're updating software, installing new drivers, or troubleshooting issues, knowing your kernel version helps ensure everything works smoothly
6 min read
How to Install Deepin on Linux?
Deepin is the top Linux distribution from China, it provides a beautiful, easy-to-use, safe, and reliable operating system for global users. Deepin is based on Debian's stable branch. The feature that sets Deepin aside from the rest of Linux distributions is its desktop environment known as DDE Deep
3 min read
How to Install JDK in Linux?
Java is a very popular general-purpose programming language, which is very close to flow Oop's theory and can run independently on any platform, but its run time environment is dependent on the platform the JVM (Java Virtual Machine) is also known as. Which first interprets Java file byte code and b
2 min read
How to Install Manjaro Linux?
Manjaro Linux is an arch-based Linux, with all the features that provide a good user interface, all other tasks that are done on the other Linux via the command-line user interface, you can use it as a graphical user interface. Manjaro is a free open-source Linux distribution based on the Arch Linux
4 min read
ed command in Linux with examples
Linux 'ed' command is used to start the ed text editor, a very minimal fronted line-based text editor. The lines are very simple in relation to other text files, hence easy to work on, for creating as well as editing, display, and manipulation of files. Since it was the first editor that was include
4 min read
15 Best Linux/UNIX Books For Beginners
Linux has a variety of operating systems with different features and functionalities. You can use Linux Distros on various hardware manufactured by IBM, Intel, HP, SPARC, etc. Whether you are a developer or a video editor, Linux has so much to offer everyone. In Linux, you can do out-of-the-box task
10 min read
How to Install Etcher on Linux
Etcher also known as balenaEtcher is an open-source tool to create bootable pen drives, and SD cards by using the ISO images of the operating systems. This tool is developed by Balena. Etcher has a very simple user interface and provides a 4-step  process to create a bootable pen drive, and it is ea
5 min read
How to Check Java Version in Linux
Java is a widely used programming language and platform, and having the correct version installed is crucial for running Java applications smoothly. If you're working on a Linux system, knowing your Java version can help ensure compatibility with tools, frameworks, or projects. Whether you're debugg
4 min read
How to Check Java Version in Linux
Java is a widely used programming language and platform, and having the correct version installed is crucial for running Java applications smoothly. If you're working on a Linux system, knowing your Java version can help ensure compatibility with tools, frameworks, or projects. Whether you're debugg
4 min read
How to Install Turbo C++ on Linux?
In this article, we will look into how to install Turbo C++ on Linux. Turbo C++ is the free and Open-Source Software, it is a development tool for writing programs in the C/C++ language. Turbo C++ is a compiler and IDE (Integrated development environment) originally from Borland. Prerequisites: To r
2 min read
How to Open a File in Linuxâ
In Linux, a file is a fundamental unit of storage, representing everything from documents and images to system logs and program data. Unlike traditional operating systems, Linux treats almost everythingâfiles, directories, devices, and processesâas a file. Whether you're accessing a simple text docu
6 min read
How to Open a File in Linuxâ
In Linux, a file is a fundamental unit of storage, representing everything from documents and images to system logs and program data. Unlike traditional operating systems, Linux treats almost everythingâfiles, directories, devices, and processesâas a file. Whether you're accessing a simple text docu
6 min read
How to Install And Run VMware Tool in Linux?
Here, we will see how to install and run the VMware Tools in the Ubuntu Linux system. Virtualization means you can use the guest operating system on your main operating system. Sometimes they help you to do some tasks that are not performable to your current operating system, so you also use a virtu
2 min read
Diving into the Linux World
Most of us have heard of Linux term and thought of it as some high-level term used by IT nerds. If not Linux then you would have heard 'Ubuntu' or 'Mint', which are variants of Linux. Basically, it is just a desktop operating system, like Windows, OS X (MacOS), Chrome OS, etc. It was developed by th
8 min read
Linux | Nmon
Nmon is a fully interactive performance monitoring command-line utility tool for Linux. It is a benchmark tool that displays performance about the CPU, MEMORY, NETWORK, DISKS, FILE SYSTEM, NFS, TOP PROCESSES, RESOURCES, AND POWER MICRO-PARTITION. INSTALLATION On Ubuntu/Debian : $ sudo apt-get instal
2 min read