Wednesday, July 4, 2007

Understanding Linux Runlevels

Unlike most non-unix operating system, Linux have many runlevels. They are numbered from 0-6 like below.

0 - halt
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot

This list is taken from /etc/inittab file where init will find its configuration setting. The default runlevel usually is set to runlevel 5 where it is the graphical mode of linux. Halt means shutdown and runlevels 1-3 are non graphical mode. You can switch your runlevel by using;

-> init

To check your current runlevel, you can use;

-> runlevel

To view this list;

-> vi /etc/inittab

1 comment:

Rishi said...

who -r can also be used to check for the runlevel.