Analyze. Act. Achieve.
Kurinchilion KURINCHILION Analyze. Act. Achieve.

News

Linux: How to find the current Run Level?

Default init level is set in /etc/inittab.

$ cat /etc/inittab (to display the init levels)

Inside that file, you can note a line which will state the run level number like id:5:initdefault: (indicating run level 5 which means that the system is running with x windows)

To find the current run level you can execute the following commands

$ who -r run-level 5 2008-07-22 21:35 last=5 which indicates that the system is in run-level 5

Other option to find the run level is $ /sbin/runlevel N 5

To find out what sub processes are associated with each run level you can go to $ cd /etc/rcN.d/ (Where N denotes the run level number)

For example $ cd /etc/rc1.d/ $ ls -l This will list symbolic links to various processes associated with run level 1.