wheforless.blogg.se

Linux shutdown command
Linux shutdown command






linux shutdown command

In this example, the machine will shut down in 5 minutes. The shutdown command followed by an integer will shut down the machine in n minutes. Similarly, the init 0, telinit 0, and poweroff commands will also shut down the machine immediately. The shutdown command followed by the word now will shut down the machine immediately. The shutdown command without any options will display time expected, as the shutdown time is required. Also if you want to learn more basic commands such as this, you can read this article.The shutdown command can be used to shutdown, poweroff, halt, or restart the operating system. We hope the article covered everything you wanted to know on the topic, but in case you need additional information, type “man shutdown” to get an overview of the utility in the command line. The Linux shutdown command is one of the easiest to use, but you should take advantage of that to turn off your system safely.

linux shutdown command

#Linux shutdown command how to

If you initiated a reboot by mistake, here is how to inform other users about it: sudo shutdown -c "Reboot canceled" Wrap Up You can add a custom message, as well as the desired time delay. The “-r” option is used to initiate a system reboot: sudo shutdown -r As for the content, it can be anything that comes to your mind. And do not forget the quotation marks before your message. If you want this command to be successful, make sure to include the time delay, too. Here is how to initiate a shutdown command while sending other users a message: sudo shutdown +60 "Maintenance" You can list all the users by using the getent command. It is a nice thing to do as you do not want to stop them in the middle of an important task. If you have multiple users registered on the system, you should inform them before you turn off Linux. Keep in mind that the system clock is the one that is relevant for this command. If you want to shutdown Linux at midnight, use the following: sudo shutdown 00:00 The “XX” portion of the line is used to set the desired hour and “MM” to set the exact minute. Turn Off the System at an Exact TimeĬalculating the number of minutes when delaying the shutdown can be a hassle. You can change the number “30” with any number of minutes you desire.

linux shutdown command

The turning off process will start in 30 minutes from the moment when you issued the command.

linux shutdown command

Here is how to do that: sudo shutdown +30 You might not be around, but you would still like the system to turn off in two hours. That command will initiate an immediate shutting down process. If you do not want to wait for an entire minute and want to turn off your Linux right away, here is what you should type: sudo shutdown now In the meantime, you can cancel the shutdown by using the following command: shutdown -c The above line will order the system to initiate the shutdown in 60 seconds as that is the default time delay when executing the command. Here is the simplest Linux shutdown command to use: sudo shutdown

  • – Inform other users on why you are shutting down Linux.ĭo not forget that you will have to use the “sudo” prefix to execute the command with the superuser permission.
  • – Specify the time when you want to initiate the command.
  • – You can choose to turn off the system, but also to reboot it when necessary.
  • In most cases, you will follow the following form: shutdown Įverything is pretty self-explanatory, but let’s reveal more details about the above command: That is why we will first learn the basic syntax of the shutdown command. We have always believed in practical examples, but we are aware of the importance of the theory. Let’s take a look at how you can put Linux shutdown commands to good use and maximize their benefits. As soon as you initiate shutting down, the system will send a message to inform other users who are logged-in, and it will prevent new logins. You can turn off your Linux system in multiple ways, but the safest one is by utilizing the shutdown command.








    Linux shutdown command