How to check current runlevel of a Linux Server

How to Find the current runlevel of a Linux Server? – Linux Commands to check current runlevel of Linux System


 

There are seven runlevel on a Linux Server (0 – 6)

Runlevel 0 – Halt
Runlevel 1 – Single User Mode
Runlevel 2 – Multi User Mode but no NFS
Runlevel 3 – Multi User Mode with Networking
Runlevel 4 – Not Used
Runlevel 5 – Multi User Mode + GUI
Runlevel 6 – reboot

Do the below steps to find the current runlevel of a Linux System/Server.

Log into your Linux Server via SSH as ‘root’ to check the current state of your Linux Server. You can use software like ‘putty’ to login to your Linux Server.

Type the command “runlevel” to check the current runlevel of a Linux Server

Command : runlevel

Find current runlevel Unix

Example is Given below :

 

-sh-4.1$ runlevel
N 3

 

N 3 = Server is in runlevel 3
N 5 = Server is in runlevel 5
 


 
Step 2 :

Alternate way to check the Runlevel of a Linux PC/Server

Command : who -r

Check Current Runlevel Linux

You can use the command “who -r” to check the current level of your linux system

 

-sh-4.1$ who -r
run-level 3 2015-12-03 06:45

 

The above server is in Runlevel 3
 


 
Step 3 :

You can check the runlevel of your Linux Server by checking the inittab file

File Name : /etc/inittab

Command : grep -i initdefault /etc/inittab

How to Find current Runlevel Linux Unix

Type the above command on your Linux System/Server

 

-sh-4.1$ grep -i initdefault /etc/inittab
id:3:initdefault:

 

id:3:initdefault = Means the server is in runlevel 3
id:5:initdefault = Means the server is in runlevel 5