So, what are run levels? Well, they are like different modes in which you can run Linux and different run levels have different configurations. They define what services or processes must be running on the system after boot. They are different run levels in Linux but you can run only one run level at a time.
For example, you can operate in Run-level 5 which have the graphical interface or in run level 3 which will not have the graphical interface.
In Red hat Linux/Fedora, the run-levels are as shown below:
Run Levels Details
1 Single user mode
2 Multi-user modes without networking
3 Multi-user mode without graphical interface
4 unused or can be user-defined
5 multi-user mode with Graphical interface as well as console logins
- Changing run-levels:
Run-levels can be changed by editing the /etc/inittab file. First, make a backup of your /etc/inittab file
# cp /etc/inittab /etc/inittab.bak
So, open /etc/inittab in your vi editor or gedit editor.
# vi /etc/inittab
Now, look for the following line :
Now, you can change the number 5 to any run-level you want. For example, if you want to change the run-level to 3 i.e. to the non-graphical interface, Then just change the change the number 5 to 3. So, it would be like:
After making the changes, save the file and reboot. Now, your Linux OS will be running in run-level 3. You can press ALT+F2 to see the log-in prompt.
- Alternative Method to change run levels:
You can also change run-levels by typing “init” followed by the “run-level”. For example, if you want to change to run-level 3, in your terminal type:
# init 3
This will reboot your machine into run-level 3.