Categories: LinuxShellUbuntu

How to Shut Down Ubuntu

Ubuntu was originally a terminal-based operating system, but over time, Linux slowly introduced the graphical user interface to its operating system. Nowadays, GUI methods are the only way to solve many problems with the operating system. We'll show you some cool methods to shut down your system in Ubuntu like a pro!

Ubuntu, like all other operating systems, offers several ways to shut down. These include such simple methods as clicking a button or passing commands to the system via a terminal. The commands shown in the tutorial have been tested on Ubuntu 24.04 and Ubuntu 22.04.

Shutdown Ubuntu using the System menu

If you use an Ubuntu desktop, it is easy to shut down or turn off the system. Ubuntu's system menu offers the option to turn off the system in a dropdown menu in the upper right corner of the desktop. When you click the power off button, a dialog box appears with 3 options.

  1. Cancel
  2. Restart
  3. Shutdown

You can decide within 60 seconds. After 60 seconds, the system will shut down automatically.

Shutdown Ubuntu by using the Terminal

The following instructions use the command line and can be used on Ubuntu servers, desktop systems, and headless installations like cloud servers. On the desktop, you can open Terminal by pressing Alt + Ctrl + T on the keyboard or by right-clicking on the desktop and clicking on an open Terminal. You'll probably use an SSH client to establish a terminal connection for servers and headless systems. Several commands are used to shut down the system.

Power off and poweroff command

Run:

sudo power off

This command immediately shuts down the system.

sudo poweroff

This command asks for a password and then shuts down the system.

Shutdown -h now

This command will immediately shut down the system.

shutdown -h now

Schedule Ubuntu Shutdown

But if you want to shut down the system after a certain time, you can specify time instead of ‘now’. It will shut down the system after the specified time. For this type of command:

shutdown -h (time in minutes)

This command will shut down the system after 1 minute.

To cancel this shutdown command, type command:

shutdown -c

An alternate command for shutting down the system after a specified time is:

Shutdown +30

This will shut down the system after 30 minutes.

You can also leave a comment with the shut down command. Type command

shutdown +30 "you have a meeting right now"

Shutdown Ubuntu at a Specified Time

If you want to shut down at a specified time like 8:03 pm type the command:

shutdown –h 20:3

Get a list of shutdown parameters

To get a list of all the parameters that can be used with the shutdown command along with their uses type command:

shutdown --help

The shutdown command can do a lot with the following parameters.

Get a list of all Power Off command parameters

The poweroff command can also be used with different parameters. To get a list of all the parameters that can be used with poweroff command along with their uses type command:

poweroff --help

So, you have to know there are many ways to shut down and power off your machine in Ubuntu. The basic commands of shutdown and poweroff with different parameters can perform various functions to halt a session. You can now use any of the ways mentioned above to power off your machine.

Vitux Staff

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago