How to reboot CentOS 9 Stream using the terminal

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. This short and simple post will help you reboot CentOS 9 Stream from the terminal. Let’s get started.

When using a modern operating system, the process of rebooting, shutting down and suspending the computer can be done via graphical interface without much hassle. However, sometimes either via scripts or commands, it is useful to know how to reboot the system with another method.

In short, we are talking about another method, such as via the terminal. Learning this can give us the opportunity to use it in configuration scripts or simply in the terminal.

As you can notice, this post is oriented to beginners, but it can also help the more advanced ones to remember how to do it.

Let’s get started.

Reboot CentOS 9 Stream using the terminal

To accomplish this, we have several commands that we can use to achieve the goal. So let’s analyze them.

The reboot command

The reboot command allows us to quickly and easily reboot the system. But the best thing is that this command not only allows us to reboot the system, but also to shut it down or halt it.

Before invoking reboot, a shutdown time record is first written to /var/log/wtmp.

To use it, we need root permissions or use it with the sudo command for example

sudo reboot
1.- Reboot CentOS 9 Stream using the terminal
1.- Reboot CentOS 9 Stream using the terminal

This will reboot the system immediately.

Rebooting the system using the poweroff command

The poweroff command gives us more flexibility when rebooting the system because it allows us to set when to reboot. But first, let’s see how to reboot the system immediately.

sudo poweroff -r now

This will reboot the system. As you can see, we need root permissions, and we can define when to do it. In this case, now implies that it will be done immediately.

However, we can tell it a specific time

sudo poweroff -r 21:00

This will indicate that the system will reboot at exactly 21:00. We can also indicate that after a few minutes it will do it,

sudo poweroff -r 30

That is to say that the system will reboot in 30 minutes.

As we can see, it is simple and comfortable to reboot the system.

Conclusion

Restarting a system from the terminal may not be the most normal thing to do, but learning how to do it is important often and especially on servers.

More posts about CentOS 9 Stream

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook