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:

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:

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:

If you want to reboot, try this command:

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:

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:

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

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:

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.

Reboot From The Terminal

The weather has had a bit of an impact on my internet connection, so this is just going to be a quick article about how you reboot from the terminal. I want to schedule this as soon as possible, so it’ll be a fairly low-effort article. This should not take long!

There are times when you may want to know how to reboot from the terminal. Then, there are times when you can’t access a GUI, and using the terminal is the cleanest method of rebooting your computer. Knowing how to reboot from the terminal might be a skill worth having. I’ll show you a couple of quick and easy ways to do this.

As the title says, this is going to take place in the terminal. You can usually just press CTRL + ALT + T to open your default terminal. You could otherwise reboot with REISUB.

So, with your terminal open…

Reboot With systemd:

The first command we’ll use to reboot your computer. We’ll be using systemd. This will only work if you’re using a distro with systemd.

Reboot With shutdown:

It should be fairly obvious that the shutdown command can be used to reboot your computer. This is one of the generic utilities, so you won’t need to install anything.

(Check the man page because there are a lot of options available.)

Reboot With reboot:

Finally, we’ll use the reboot command to reboot your computer. This might be the easiest to remember and you shouldn’t need to install anything new. You need the following command:

In some distros, you can drop the ‘now’ and the command will still reboot your computer immediately. 

Closure:

So, there you have it. You have a new article and it should even be published on time. It’s not a long article. The subject is easy enough. You’ll never know when you need to reboot from the terminal, and now you do.

Ah well…

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.

 

Let’s Learn About Halt

Today’s article is about the halt command. The reason we’re writing about the halt command today is because I was halfway through another article before I realized I’d already written an article on that subject. So, this is going to just be a nice, easy article.

And, yes, yes I did write more than half of an article that I’ve already written. I ain’t even intoxicated!

The command we’re looking at using today is called ‘halt’. For such a little command, here’s an interesting post about the difference between halt and shutdown. And, if that’s not enough, you can read the other answers and comments on that page. 

Anyhow, halt is described like this in the man page:

halt, poweroff, reboot – Halt, power-off or reboot the machine

Of those three, we’ll just be covering the halt. Yes, the man page contains all three in just one page. They’re all related. As I said, we’ll just be covering the useful features of halt command today.

And, without further ado…

The Halt Command:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have the terminal open, the first use of halt would be just to halt the system:

That will halt your CPU. It probably won’t shutdown your computer all the way, it will just stop it. So too won’t the -f (force) flag. If you force it, it just stops the CPU. It looks like and requires sudo:

Finally, of the options we’ll cover, is the -p flag, and the -p stands for poweroff. It’s just another way to shut down your computer, and it obviously looks like this:

Those are about the only ways you’re ever going to use it, if you use it at all. It’s not a command that you’re likely to bump into but now you know it exists and how to use it.

Closure:

There you have it, another article. This one covers the halt command in Linux. It’s not a major article, but I needed one in a hurry – just to ensure there’s one scheduled. While my health is mostly returned, I’m still not so caught up that I have a bunch of extra articles. Feel free to step up and write one or two!

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Shutdown Linux From The Terminal

Today’s article is going to tell you how to shutdown from the terminal. I’ve previously explained how to reboot a ‘frozen’ Linux system using the Magic SysReq keys. Today, we’ll shutdown from the terminal. It’s a quick and easy article – as the holidays are eating a bit of my “free” time.

Why would you want to do this? Well, if your Linux system isn’t quite frozen or your desktop GUI isn’t something you can reach, then you may want to press something like CTRL + ALT + F3. That should crack open a TTY where you can login and issue commands to your system. Maybe you’re working on a server and need to shut it down? Who knows, but the command is there and it’s a useful command to keep in mind.

For this article, we’ll mostly be using the shutdown command, and the man page defines it as:

shutdown – Halt, power-off or reboot the machine

And it does pretty much what you’d expect from such a command. However, it’s not just a basic command, there are flags and some options that go along with it. So, we might as well take the time to learn about it. After all, you never know when you want to shutdown Linux from the terminal.

Shutdown Linux From The Terminal:

Like oh so many articles, this one will require an open terminal. If you’re connected to a remote server via SSH, you already have a terminal to work with. If not, just press CTRL + ALT + T and your default terminal should open.

Once you’re ready to shutdown your Linux system, you can enter the following to shutdown immediately:

Obviously, that command will shutdown the system immediately, so don’t practice it unless you plan on shutting down – ’cause you will. You can even shutdown at a specific time by using this format (and 24h time):

You can also use the +MM function. To shutdown in 10 minutes, you’d use a command like this:

If you change that +10 to +0, it will also shutdown immediately. If you have users of the system who should be notified of an impending shutdown, then you can actually send them a message. That would look like:

So, what happens if you schedule a shutdown and need to stop it for some reason? Fortunately, the shutdown command will let you cancel an impending shutdown – so long as you get there in time. That’s done with the -c flag, of course.

If your cancellation will impact the users, you can even include a message in that. It’s done like this:

And that’s about it, really. There’s a bit more to the shutdown command, but it’s mostly going to be used in one of the ways mentioned in this article. If you want more information about the shutdown command, simply run man shutdown and read the help file.

Closure:

And there’s another article. This one will tell you how to shutdown Linux from the terminal, a handy skill to have as a user or as an admin. It may seem like a pretty basic command, but that doesn’t mean it can’t be included on the site. 

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.