Command Line

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you will be familiar with, as we take a quick look at the shutdown command. This is pretty basic and something everyone should be familiar with.

Our pure-GUI users will just shut the computer down with the menu option but sometimes a GUI is unresponsive. There are other times when you don’t have GUI access, as there’s no desktop environment loaded. When this happens, you can still shut the computer down. To do this, you can use the shutdown command.

There’s not a lot to the shutdown command, but the good news is that you won’t have to install anything to use it. If you’ve got a Linux system, you’ve got access to the shutdown command.

In fact…

shutdown:

As I said, you won’t need to install anything to use the shutdown command. It’s something that’s built in. You can check the man page with the following terminal prompt:

man shutdown

If you run that command, you’ll see that this is the correct tool for the job. It will in fact shut down the computer, though it has a few options that we’ll cover. We won’t cover everything,  just the things you’re likely to need.

The man page describes the command like so:

shutdown – Halt, power-off or reboot the machine

See? If you want to shut the computer down (including halt and reboot) then this is the correct command for the job.

The Shutdown Command:

As mentioned above, this is a terminal-based command. That means you’re going to need an open terminal. If you press CTRL + ALT + T a terminal should pop up. If not, there’s a terminal in your application menu.

Some systems may require ‘sudo‘ for this. This is not true for all distros and you’ll need to discover that on your own. I’ll omit the sudo in this article.

The basic syntax is this:

shutdown

That command will stop anyone from logging in and shut the computer down in five minutes. It’s the basic usage of the shutdown command.

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

shutdown now

If you want to reboot, try this command:

shutdown -r

Again, that will reboot the computer in five minutes and stop anyone from logging into the system. 

If you want to reboot immediately, add ‘now’ to the command like so:

shutdown -r now

You can also halt the system. If you halt the system, it will remain powered on but all CPU functions will cease immediately. That works just like the above commands. To halt the system in five minutes run this command:

shutdown -h

If you want to halt the system immediately, run this command:

shutdown -h now

You’ll need to power the system down and back on with the power button.

You can also schedule a shutdown, reboot, or halt. To do that, you use the HH:MM (hours/minutes in 24-hour time), like so:

shutdown HH:MM
shutdown -r HH:MM
shutdown -h HH:MM

If you schedule a shutdown, nobody will be able to log in within five minutes of the scheduled shutdown command. You’ll remain logged in and people can log in until that time is reached, but after that time is reached no new users can log into the system.

There is more to the shutdown command but that’s all you’ll realistically need, even as a system administrator. And, if you don’t know this already, you’re a system administrator even if you’re just a basic Linux desktop user. You’re in control of your computer.

Closure:

I thought I’d cover the shutdown command because it’s something I haven’t covered yet. I started off trying to cover the basics first, but I didn’t cover everything. There are still basic functions that I’ve yet to cover. I’ll get to them eventually.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Legitimate Reasons To Not Use Linux

Today's article is going to be something my regular readers wouldn't expect as we discuss…

14 hours ago

Meta: The State Of Linux Tips #23

Today's article is just a meta article, an article that I fail to write every…

3 days ago

Is Your Storage Drive An SSD Or An HDD?

Today's article aims to answer a simple question, simply is your storage drive an SSD…

5 days ago

Monitor System Resources With “Resources”

Today is one of those days when I'd like to introduce you to new software…

7 days ago

Short: The Halt Command

Today's article is intentionally short because we're simply going to learn about the basics of…

1 week ago

Installing Flatpaks In Linux

Today we're going to have a pretty easy article where you'll learn about installing Flatpaks…

2 weeks ago