How to Shut Down Ubuntu Using the Terminal

This quick guide will show you how to shut down Ubuntu while only using the terminal.

Shutdown Ubuntu using the terminal

Knowing how to shut down an Ubuntu machine while only using the terminal is crucial for anyone who uses it as their daily machine. This is especially true when managing your system remotely using tools such as SSH.

Like shutting down your system from the GUI, turning off your system using the terminal is straightforward. In fact, you need to remember only a single command.

Like most system-wide commands on Ubuntu, shutting down requires your user to have sudo privileges.

If you are using a desktop flavour of Ubuntu, you will need to open the terminal before you proceed any further with this guide. You can open the terminal by pressing CTRL + ALT + T on your keyboard.

The following section will show you how to shut down your Ubuntu system from the terminal. We will also show you different ways this command can be used to change when exactly your device is powered down.

Using the Terminal to Shut Down Ubuntu

The sections below will show how exactly you can shut down an Ubuntu system using only the terminal.

Even if you are unfamiliar with the terminal, you should find this process relatively easy.

Basic Way of Shutting down your System

The command that you will be using to shut down your Ubuntu system is called the shutdown command. It is very simple to use, is utilized by almost every Linux system, and can even be utilized without specifying any parameters.

When you use this command on Ubuntu without specifying any options, it will schedule a shutdown for 5 minutes from when you ran the command.

sudo shutdown

Shutdown Ubuntu Immediately

If you don’t want to wait for a specific time for your Ubuntu system to be shut down from the terminal, you can utilize the “now” keyword.

This keyword tells the system that you want to power off your system immediately and does not require a wait before it is executed.

sudo shutdown now

Scheduling your Ubuntu System to Shut Down from the Terminal

Ubuntu offers the ability for you to schedule a shutdown from within the terminal. This is useful when you know that you want your device to power off at a certain time.

You can schedule a shutdown in two different ways that we will quickly go over.

Shut Down at a Specific Time

The first way that you can schedule your Ubuntu system to shut down is to specify an absolute time.

This time must be written using the 24-hour notation and be written after your “shutdown” call, as we have shown below.

sudo shutdown TIME

For example, if we wanted our Ubuntu system to shutdown at 6 PM we would use the following command within the terminal.

sudo shutdown 18:00

Shut Down in X amount of Minutes

Ubuntu also offers you the ability to shut down your system from the terminal after a specific amount of minutes have passed.

Scheduling a shutdown like this is useful when you want it to occur after a certain amount of time has passed but don’t want to have to work out the time yourself manually.

To specify the time in a relative format, you will want to use the shutdown command, followed by the plus symbol, and then the time in minutes before shutdown.

sudo shutdown +MINUTES

For example, to shut down Ubuntu after 30 minutes have passed, you would use the command below within the terminal.

sudo shutdown +30

Cancelling a Scheduled Shut Down

It is possible to cancel any scheduled shutdown requests using a single command.

To cancel a shutdown request from the terminal, you only need to use the following command. The “-c” option tells the system that you want to cancel the pending event.

sudo shutdown -c

Conclusion

Hopefully, this quick guide has shown you how exactly you can shut down Ubuntu from the terminal.

The shutdown command is common on most Linux systems and is the same way you can power down the operating system.

Please feel free to comment below if you have any trouble getting your system to shut down.

If you found this guide helpful, many other Ubuntu guides explore numerous parts of the system.

Leave a Reply

Your email address will not be published. Required fields are marked *