{"id":15823,"date":"2019-03-05T09:51:23","date_gmt":"2019-03-05T09:51:23","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15823"},"modified":"2025-04-28T07:58:16","modified_gmt":"2025-04-28T07:58:16","slug":"linux-shutdown-command","status":"publish","type":"post","link":"\/uk\/tutorials\/linux-shutdown-command","title":{"rendered":"How to Use the Linux Shutdown Command in Ubuntu and CentOS"},"content":{"rendered":"<p>Most of the popular Operating systems out there allow you to shut down your PC or laptop with different methods. Linux operating systems also has ways for a user to safely shutdown, reboot, hibernate or suspend your Unix based machine. In this tutorial, we&rsquo;ll show you how to use the shutdown safely, reboot, hibernate your VPS using Linux commands.<\/p><p>We&rsquo;ll walk you through the process using two different Linux distributions: CentOS and Ubuntu 22.04.<\/p><p>Every operating system requires a shutdown or reboot to keep things running as they should. Shutting down a server via the command line is a secure method because it notifies all logged in users that the system is about to be turned off.<\/p><p>Here, you&rsquo;ll even learn how to trigger the OS to power off on a schedule using Linux commands.<\/p><p><strong>A Brief Overview of the Linux Shutdown Command:<\/strong><\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td>Required Knowledge<\/td><td>Basic Linux commands, Terminal usage<\/td><\/tr><tr><td>Privileges Required<\/td><td>Root<\/td><\/tr><tr><td>Difficulty<\/td><td>Beginner<\/td><\/tr><tr><td>Main Goal<\/td><td>Shutdown, Reboot, and System Power Management<\/td><\/tr><tr><td>OS Compatibility<\/td><td>Linux Distributions, Unix-like Systems<\/td><\/tr><\/tbody><\/table><\/figure><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet-1024x283.png\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet-768x212.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2022\/11\/Linux-cheat-sheet.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-what-is-the-shutdown-command\">What Is the Shutdown Command <\/h2><p>The shutdown command in Ubuntu and CentOS lets you power off, reboot, and halt your system. Below is the command syntax that is used to shutdown and restart the machine.<\/p><pre class=\"wp-block-preformatted\">Shutdown [OPTIONS] [TIME] [WALL]<\/pre><p>The shutdown command can also reboot, halt, or power off your system.<\/p><p>The first argument of <strong>[OPTIONS]<\/strong> can be a time string. After the argument, optionally you can type in a wall message to notify the logged-in users before shutting down your system.<\/p><p>The format for the time string is <strong>hh:mm<\/strong> (hour\/minute) &ndash; a 24-hour time format. This will specify the time to execute the shutdown command. Alternatively, you can use <strong>+m<\/strong> where <strong>m<\/strong> indicates minutes. It will instruct the machine to shutdown in the number of minutes you want.<\/p><p>You can also use <strong>now<\/strong> in the syntax which is an alias for <strong>+0<\/strong>, this will trigger an immediate shutdown of your VPS. If you don&rsquo;t specify the <strong>[time]<\/strong> argument, Linux as default implies<strong> +1<\/strong> before shutting down.<\/p><p>Bear in mind that a time argument is a must if you want to specify a wall message. The <strong>\/run\/nologin<\/strong> file will be created 5 minutes before the system shuts down only if you have implied a time argument to ensure that further logins are not to be allowed.<\/p><h2 class=\"wp-block-heading\" id=\"h-shutdown-command-examples-in-linux-and-centos\">Shutdown Command Examples in Linux and CentOS<\/h2><p>Now let&rsquo;s go over some basic shutdown command usage in Linux and CentOS.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-use-the-shutdown-command-in-linux-ubuntu-and-centos\">How to Use the Shutdown Command in Linux Ubuntu and CentOS<\/h3><p>The shutdown command for Ubuntu and CentOS is relatively similar. Each command shown below can be used in its dedicated Terminal. Remember, that you&rsquo;ll have to use SSH to access your VPS. We have a <a href=\"\/uk\/tutorials\/how-to-use-putty-ssh\">tutorial<\/a> covering the process with PuTTY!<\/p><p>The basic shutdown command for both CentOS and Ubuntu looks like this:<\/p><pre class=\"wp-block-preformatted\">shutdown<\/pre><p>The command above will not shut down your PC immediately; it will set a one-minute timer before shutting down. Remember to save your work before the shutdown takes place.<\/p><p>To shut down your PC immediately, type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">shutdown now<\/pre><p>As we mentioned before, here, the command for both OS is the same.<\/p><p>To shut down your PC at a dedicated time, type in the following command into the command line and hit enter:<\/p><pre class=\"wp-block-preformatted\">shutdown hh:mm<\/pre><p>The Linux shutdown command follows a 24 hours format so type in hours instead of <strong>hh<\/strong> and minutes instead of <strong>mm<\/strong>.<\/p><p>To shut down after a few minutes or hours, type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">shutdown +m<\/pre><p>Remember, here m indicates minutes. Just specify the number of minutes.<\/p><p>To show a message to the people who are logged in your VPS type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">Shutdown +m &ldquo;Please save your Work, the PC will Shutdown in 5 Minutes&rdquo;<\/pre><p>Here the text in quotes can be whatever message you&rsquo;d like.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-restart-your-vps-using-the-shutdown-command-in-linux\">How to Restart Your VPS using the Shutdown Command in Linux<\/h3><p>To restart or reboot your PC safely, use the following command below:<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;r<\/pre><p>The command won&rsquo;t reboot your machine immediately, it will set a one-minute timer before rebooting. For this, you can save your work before reboot takes place.<\/p><p>To restart your PC immediately, just add the now option, as you did previously.<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;r now<\/pre><p>To schedule a restart for your system, type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;r hh:mm<\/pre><p>To restart after few minutes or hours, type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;r +m<\/pre><p>Remember, here <strong>m<\/strong> indicates minutes. Just specify the number of minutes.<\/p><p>To show the message to the people who are logged in with your server before the it goes down, type in the following command and hit enter:<\/p><pre class=\"wp-block-preformatted\">Shutdown &ndash;r +m &ldquo;Please save your Work, the PC will restart in 5 Minutes&rdquo;<\/pre><p>Here are some additional Linux shutdown command options you should be familiar with:<\/p><ul class=\"wp-block-list\">\n<li>-poweroff, -P : like halt Powers off the system (also turns off unit)<\/li>\n\n\n\n<li>-reboot, -r : Reboot the system.<\/li>\n\n\n\n<li>-halt, -h : Halt the machine after terminating processes.<\/li>\n<\/ul><p>You can also shut down the using the halt and power off options using the following command<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;h<\/pre><p>For powering off use:<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;p<\/pre><p>In the above commands, you can also specify the time and then wall message after the option argument.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/uk\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-how-to-cancel-a-scheduled-shutdown-command-in-linux\">How to Cancel a Scheduled Shutdown Command in Linux<\/h3><p>To cancel a Scheduled shutdown or a restart of your PC, you can simply type in the following command before you reach the dedicated time of the scheduled shutdown of your PC.<\/p><pre class=\"wp-block-preformatted\">shutdown &ndash;c<\/pre><p>These commands will immediately cancel the specified scheduled time of shutdown or restart. You cannot use this command If you used <strong>+0<\/strong> or <strong>now<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>That&rsquo;s it, hope this article helped you learn how to use the Linux shutdown command and its options. If you faced any confusion in the tutorial, please let us know so we can resolve it for you!<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Discover Other Linux Commands for Server Management<\/h4>\n                    <p><a href=\"\/uk\/tutorials\/vps\/how-to-check-and-manage-disk-space-via-terminal\/\">How to Check Disk Space on Linux<\/a><br>\n<a href=\"\/uk\/tutorials\/curl-command-with-examples-linux\/\">How to Transfer Data With Curl Command<\/a><br>\n<a href=\"\/uk\/tutorials\/linux-time-command\/\">How to Calculate Process Execution With Time Command<\/a><br>\n<a href=\"\/uk\/tutorials\/using-scp-command-to-transfer-files\/\">How to Transfer Files Using Scp Command<\/a><br>\n<a href=\"\/uk\/tutorials\/linux-watch-command\/\">How to Monitor Changes With Watch Command<\/a><br>\n<a href=\"\/uk\/tutorials\/how-to-use-rsync\/\">How to Transfer and Synchronize Data With Rsync<\/a><br>\n<a href=\"\/uk\/tutorials\/manage-and-list-services-in-linux\/\">How to Manage and List Services in Linux<\/a><br>\n<a href=\"\/uk\/tutorials\/how-to-kill-a-process-in-linux\">How to Kill a Process in Linux<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the popular Operating systems out there allow you to shut down your PC or laptop with different methods. Linux operating systems also has ways for a user to safely shutdown, reboot, hibernate or suspend your Unix based machine. In this tutorial, we&rsquo;ll show you how to use the shutdown safely, reboot, hibernate your [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/linux-shutdown-command\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":110,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"Using the Linux Shutdown Command \u2013 a Step-by-Step Guide + Examples","rank_math_description":"Rebooting and powering down your system is essential for its health. Here's how you can do it with the Linux shutdown command.","rank_math_focus_keyword":"linux shutdown command","footnotes":""},"categories":[22644,22640],"tags":[],"class_list":["post-15823","post","type-post","status-publish","format-standard","hentry","category-managing-monitoring-and-security","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/linux-shutdown-command","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/commande-shutdown-de-linux","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/comando-shutdown-linux","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/perintah-shutdown-linux","default":0},{"locale":"ja-JP","link":"https:\/\/www.hostinger.com\/jp\/tutorials\/linux-shutdown-command","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/linux-shutdown-command","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/linux-shutdown-command\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/linux-shutdown-command\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/comando-shutdown-linux","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/comando-shutdown-linux","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/comando-shutdown-linux","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/linux-shutdown-command","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/linux-shutdown-command","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/linux-shutdown-command","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/linux-shutdown-command","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=15823"}],"version-history":[{"count":30,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15823\/revisions"}],"predecessor-version":[{"id":118966,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15823\/revisions\/118966"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=15823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=15823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=15823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}