How to schedule a shutdown in Linux?

Windows Articles

How to update apps on Android

Hi folks! In this post, we will show you how to update your Android apps. Updating the apps on your device is...

How to install Apache Ant on Ubuntu 20.04?

Hello, friends. Apache Ant is a very important tool for the development of applications in Java. So in this post, we will...

How to use the ss command

For Linux users, there will come a time when you need to know about the network. Several tools help in this process,...

How to create user template in Windows Server 2019/2016

Hello! Windows Server has many features that support system administration. For example, through the users it is possible to manage many administrative...

Debian 10.6 available

Several volunteers have developed the free software distributed under the name of Debian. Debian does not sell its software directly, the developers...
angeloma
angeloma
Senior Writer and partner

Shutting down and restarting a computer is too common a task. It is also quite simple thanks to the numerous options in the graphical interfaces. But there is one option that is not always present and that is to program shutdown in Linux. This is especially useful if we manage servers or remote computers or simply leave a task on our computer and we have to leave. So in this post, we’ll show you how to program shutdown in Linux. You can apply this to any Linux distribution.

As you well know, shutting down a computer correctly helps the hardware not suffer. This way you will protect the hard disk, the power supply, and other things. On the other hand, some security updates require at least one reboot to apply the changes. Of course, this in terms of servers, has evolved exponentially.

So let’s go for it.

Shutdown in Linux

Let’s start at the beginning. The command that allows you to shut down a Linux system is the shutdown command. So its operation is quite simple. However, to run it, in some cases, you need to have root privileges.

If you want to shut down the computer immediately, you can use this command:

:~$ sudo shutdown now

As simple as that, as you can see.

Now, we can also program shutdown in Linux using this same command. The trick is to directly specify the time we want it to be done.

:~$ sudo shutdown 13:30

The previous command brings a consequence that the system will be turned off at 13:30 closer to the local time.

Another way to turn off the program on Linux is to tell the command a defined time. For example, we want the system to shut down within 40 minutes. To do this, we follow this command:

:~$ sudo shutdown +40

That’s enough. Now let’s see how to reboot the system.

That’s enough. Now let’s see how to reboot the system. To do this, just add the -r argument to the shutdown command.

If you want to schedule a restart at a certain time, run the following command:

:~$ sudo shutdown -r 12:30

On the other hand, if you want to do it in a certain amount of minutes, use the following command:

:~$ sudo shutdown -r +20

Finally, if you have programmed shutdown in Linux and want to cancel it. Use the following command:

:~$ sudo shutdown -c

And that’s it.

Conclusion

Programming off in Linux is one of those tricks quite useful for the use of the system. So we can schedule tasks and then shut down the computer, even on a small server or local is of maximum benefit.

You can also read about the ls command or the CURL command.

Please share this post with your friends.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to update apps on Android

Hi folks! In this post, we will show you how to update your Android apps. Updating the apps on your device is...

How to install Apache Ant on Ubuntu 20.04?

Hello, friends. Apache Ant is a very important tool for the development of applications in Java. So in this post, we will...

How to use the ss command

For Linux users, there will come a time when you need to know about the network. Several tools help in this process,...

How to create user template in Windows Server 2019/2016

Hello! Windows Server has many features that support system administration. For example, through the users it is possible to manage many administrative...

Debian 10.6 available

Several volunteers have developed the free software distributed under the name of Debian. Debian does not sell its software directly, the developers...