Linux define the runlevel and determine which runlevel my system is currently in

by on September 2, 2006 · 3 comments· last updated at September 6, 2006

Q. How to define the Linux system runlevel and how do I determine which runlevel my system is currently in?

A. You need to use runlevel command to find the current and previous system runlevel. Usaully 0-6 runlevel are used by all Linux distributions:

=> 0 : Halt system

=> 1 : Take system to single-user mode (good for Linux system maintenance)

=> 2 : User defined or distribution like Debian use it

=> 3 : Full multi-user mode (text mode login)

=> 4 : Not used/user-defined

=> 5 : Full multi-user GUI mode login

=> 6 : Reboot system

Please note that runlevels 0, 1, and 6 are reserved. Runlevel 0 is used to halt the system, runlevel 6 is used to reboot the system, and runlevel 1 is used to get the system down into single user mode.

Task: Determine which runlevel my system is currently in

Type runlevel command:
$ runlevel

Output:

N 3

runlevel command reads the system utmp file (typically /var/run/utmp) to locate the runlevel record, and then prints the previous and current system runlevel on its standard output, separated by a single space. If there is no previous system runlevel, the letter N will be printed instead.

Task: Change runlevel

Use init command to change the runlevel. For example runlevel 1 is used to get the system down into single user mode:
# init 1



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 3 comments… read them below or add one }

1 sheik August 31, 2010 at 7:07 pm

how to increase or add run level on rhel . . .
psl help me . .

Reply

2 Paulomjeet April 30, 2011 at 1:15 am

Can you increase runlevels in linux? If you increase run levels how to increase?

Reply

3 eswarreddy March 19, 2012 at 6:07 pm

i want only previous runlevel and current runlevel individually
ex:
runlevel
3 5
3 =present
5=previous.
i want inly one runlevel
help me……………………………………

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as:

Previous Faq:

Next Faq: