How to Shutdown Ubuntu 18.04

It doesn’t matter how silly it sounds but shutdown is a major part of our computing. You definitely want to shut down your PC or laptop after usage unless you’re running a server or you’re just crazy. Even servers need to reboot themselves from time to time to make sure that everything is going fine. The general users (including pro and ultra-gamers as well) also need to shut our system down.

In Linux, the shutdown is pretty simple. You click the power button from your launcher and voila! However, did you know that this SHUTDOWN is also highly customizable? Yes, you can even decide when to shut down and how!

Let’s check out the amazing world of “SHUTDOWN” on Ubuntu 18.04. My machine is running Xubuntu 18.04 – the Xfce flavor of Ubuntu. That being said, all the other Ubuntu versions and Ubuntu-based distros will work just fine. In fact, almost all the commands should work just fine on any Linux distro!

The SHUTDOWN command

Let’s fire up the terminal and run the following commands –

sudo -s
shutdown -P now

What does this command say? At first, we’re making sure that our command runs as the root user so that all the apps will have to close themselves during the shutting down process, no interruption. The second command tells “shutdown” tool to shut the system down right now. Literally, right now!

This screenshot was from my Deepin installation on VirtualBox.

Think of yourself in a certain scenario where you’re listening to music and falling into sleep. You want to run your computer up to 3:00 AM. What to do now? Just run the following command –

sudo -s
shutdown -P 03:00

This thing will make sure to shut down your system exactly at 3:00 AM or, as we’ve used in the command, at 03:00 (24-hr format). If you’re in need of converting time from 12-hr to 24-hr, check out the awesome time calculator to do the job for you.

Well, you can also schedule rebooting your system with “shutdown”. It’s kind of funny to think that “shutdown” can re-“start”, right? For restarting at a certain time, run the following command –

sudo -s
shutdown -r 03:00

This will tell the “shutdown” tool to restart the system at 3:00 AM. Like before, you have to enter a 24-hr format of time to do so.

Need to cancel the shutdown? Run the following command in the terminal –

shutdown -c

This will stop the shutdown from performing any task you asked to do before.

Suspending and waking up

Now, another awesome thing you can do is to suspend your system. Suspending temporarily stops the system from running and puts it in a “frozen” state. This way, it doesn’t use the hardware that much, ensuring less energy consumption.

Using another tool “rtcwake”, we can easily manage scheduling suspending the system and waking it up after a certain time.

There are 2 types of suspend options available – memory and disk. In the case of “disk” suspension, all the apps are paused and the state of the machine is stored in the storage device. When the system wakes up, it restores all the data from the “disk”. “Memory” suspension just pauses all the app activity. This one is relatively faster to start.

“rtcwake” follows the following structure –

rtcwake [options…]

If you want to suspend your system to disk, run the following command –

sudo rtcwake -m disk -s 1000

For suspending the system to memory, run this command –

sudo rtcwake -m memory -s 1000

Here are 2 parameters for “rtcwake” –

  • m – Telling “rtcwake” the type of suspension.
  • s – Fixing the time after which the system will wake up. Usually in seconds.

If you have problem working with seconds, don’t worry. Here’s another awesome tool to help you out.

A problem working with the “rtcwake” tool is that, your system will suspend immediately. Need to work with your computer for a few more minutes/hours? Then, change your “rtcwake” command as below –

sudo rtcwake -m no -s 1000

This command will tell the tool to only WAKE the computer after 1000 seconds. Don’t forget to change the time with your preferable duration and remember to suspend your system before the time limit expires.


Sandclock IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, Sandclock IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to create a docker image?

How to create a docker image? Docker is a tool that is designed to benefit both developers and system administrators, making...

Install Samba on Ubuntu

Ubuntu 16.04 as an SMB File Server Linux belongs in the server space, and as a sysadmin, one of the most common tasks is...

How to Install and Use Write Note Taking App on Ubuntu

Write is a cross platform note taking app from Stylus Labs. Write don’t have a lot of features. It is a really simple...
Bài Viết

Bài Viết Mới Cập Nhật

Hướng dẫn chuyển đổi windows server windows evaluation to standard và active windows server 2008 + 2012 + 2016 + 2019

How to Update Ubuntu Linux

Squid Proxy Manager cài đặt và quản lý Proxy Squid tự động trên ubuntu

Hướng dẫn cài đặt Apache CloudStack

Hướng dẫn ký file PDF bằng chữ ký số (chữ ký điện tử) và sửa lỗi mới nhất 2021 foxit reader