{"id":3511,"date":"2012-07-07T11:21:37","date_gmt":"2012-07-07T03:21:37","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=3511"},"modified":"2023-06-22T21:06:19","modified_gmt":"2023-06-22T21:06:19","slug":"how-to-check-and-display-runlevel-on-unix-or-linux-system","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-check-and-display-runlevel-on-unix-or-linux-system\/","title":{"rendered":"How to Check and Display Runlevel on Unix or Linux System"},"content":{"rendered":"<p>In Unix or Linux servers, understanding and checking runlevels is a crucial skill for any webmaster or system administrator. A runlevel is a software configuration of the system that allows only a selected group of processes to exist. These processes are spawned by the init command\/process, and each runlevel&#8217;s processes are defined in the \/etc\/inittab file.<\/p>\n<p>Typically, runlevels 0, 1, and 6 are reserved for specific purposes:<\/p>\n<ul>\n<li>0 \u2013 Halt<\/li>\n<li>1 \u2013 Single mode<\/li>\n<li>6 \u2013 Reboot<\/li>\n<\/ul>\n<p>On the other hand, runlevels 2, 3, 4, and 5 are used for the following:<\/p>\n<ul>\n<li>2 \u2013 Multi-User Mode<\/li>\n<li>3 \u2013 Multi-User Mode with Networking<\/li>\n<li>4 \u2013 Not used\/User-definable<\/li>\n<li>5 \u2013 Start the system normally with appropriate display manager (with GUI)<\/li>\n<\/ul>\n<h2>Checking and Displaying Runlevel Using the &#8220;who&#8221; Command<\/h2>\n<p>The &#8220;who&#8221; command is a simple and effective way to check and display the current runlevel. Here&#8217;s how you can use it:<\/p>\n<pre>\r\n[root@centos62 ~]# who -r\r\nrun-level 3 2012-07-07 09:58\r\n<\/pre>\n<p>This command will display the current runlevel, in this case, runlevel 3.<\/p>\n<h2>Checking and Displaying Current and Previous System Runlevel Using the &#8220;runlevel&#8221; Command<\/h2>\n<p>The &#8220;runlevel&#8221; command is another useful tool for checking and displaying the current and previous system runlevel. Here&#8217;s how to use it:<\/p>\n<pre>\r\n[root@centos62 ~]# runlevel\r\nN 3\r\n<\/pre>\n<p>This command will display the previous runlevel (N for none if the system has not changed runlevel since boot) and the current runlevel.<\/p>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">who -r<\/span> \u2013 Checks and displays the current runlevel<\/li>\n<li><span class=\"fw-bold\">runlevel<\/span> \u2013 Checks and displays the current and previous system runlevel<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Understanding and checking runlevels in Unix or Linux systems is a fundamental skill for any webmaster or system administrator. By using the &#8220;who -r&#8221; and &#8220;runlevel&#8221; commands, you can easily check the current and previous runlevels.<\/p>\n<p>Remember, each runlevel has a specific purpose and allows only a selected group of processes to exist.<\/p>\n<h2>FAQs<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is a runlevel in Unix or Linux systems?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">A runlevel is a software configuration of the system that allows only a selected group of processes to exist. These processes are spawned by the init command\/process, and each runlevel&#8217;s processes are defined in the \/etc\/inittab file.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What are the purposes of runlevels 0, 1, and 6?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">In Unix or Linux systems, runlevels 0, 1, and 6 are reserved for specific purposes. Runlevel 0 is used to halt the system, runlevel 1 is for single-user mode, and runlevel 6 is for rebooting the system.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What are the uses of runlevels 2, 3, 4, and 5?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Runlevels 2, 3, 4, and 5 in Unix or Linux systems are used for different modes. Runlevel 2 is for multi-user mode, runlevel 3 is for multi-user mode with networking, runlevel 4 is not used and is user-definable, and runlevel 5 is used to start the system normally with an appropriate display manager (with GUI).<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How can I check the current runlevel using the &#8220;who&#8221; command?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can check the current runlevel by using the &#8220;who -r&#8221; command in the terminal. This command will display the current runlevel.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How can I check the current and previous runlevels using the &#8220;runlevel&#8221; command?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can check the current and previous runlevels by using the &#8220;runlevel&#8221; command in the terminal. This command will display the previous runlevel (N for none if the system has not changed runlevel since boot) and the current runlevel.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In Unix or Linux servers, understanding and checking runlevels is a crucial skill for any webmaster or system administrator. A runlevel is a software configuration of the system that allows&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1228,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,2058,1042],"tags":[1244,1276,1335,1536,1546,1713],"class_list":["post-3511","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-rhel","category-runlevel","tag-centos","tag-check-runlevel","tag-display-runlevel","tag-linux","tag-linux-utilities","tag-rhel"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=3511"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/3511\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1228"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=3511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=3511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=3511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}