×


Ways to Shutdown CentOS 8

The shutdown command brings the system down in a secure way.

When the shutdown is initiated, all logged-in users and processes are notified that the system is going down, and no further logins are allowed. 

You can shut down your system immediately or at the specified time.

Unlike other devices, you should not shutdown your computer systems by pressing the same power button you used to turn it on. By doing this, you might end up losing your data and corrupting the system. 

It is necessary to properly and safely shutdown the system as it closes all the programs and safely exits the OS, ensuring the system does not get corrupted.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform CentOS related queries.

In this context, we shall look into different ways to shutdown the CentOS system. 


How to shutdown CentOS system ?

You can shutdown the system using either of the following methods:

i. Via command line.

ii. Via GUI (Graphical User Interface).


Different methods to shutdown CentOS System

1. Shutdown CentOS Via Command line.

Here, you will learn some of the command line ways to shutdown a CentOS system.


i. Via the "shutdown" Command

The CentOS system can be shutdown using the "shutdown" command. It can be used in various ways which have discussed here.


To Shutdown the system immediately:

To shutdown the system immediately, issue any of the following commands in Terminal:

$ shutdown -p now

or

$ shutdown -p 0

The system will start the shutdown process right after running any of the above commands.


To Shutdown after m minutes:

You can also schedule the shutdown process by specifying the time in minutes. For instance, to shutdown the system after 10 minutes, the command would be:

$ sudo shutdown -p +10


To Send a message before the shutdown:

You can also send a notification message to all logged-in users before shutting down the system.

For instance, the following command will shutdown the system after 10 minutes along with sending the message to users:

$ sudo shutdown –p +10 "System is going to shutdown in 10 minutes"


To Cancel shutdown:

To cancel a scheduled shutdown, issue the following command:

$ sudo shutdown -c


ii. Via the "halt" Command

Another command to shutdown the CentOS system is the "halt" command. Use the "halt" command with -p option to shutdown the system:

$ halt -p


iii. Via the "poweroff" Command

With the "poweroff" command, you can also shutdown the system. 

Execute the following command in Terminal to shutdown the CentOS system:

$ poweroff


iv. Via the "telinit" Command

The telinit command in Linux can also be used to shutdown the CentOS system. 

Simply execute telinit followed by 0 to shutdown the system.

$ telinit 0


2. Shutdown CentOS Via GUI

Here, your will learn some of the GUI ways to shutdown a CentOS system.


i. Via the Power Off Button:

In your CentOS desktop, go to the top right corner of the menu bar and click the drop-down icon.

By doing so, the system menu will show up on your desktop. Then in order to shut down your system, click the power icon.

You will see the below prompt informing you that your system is going to shutdown in 1 minute.

In the meanwhile, you have the following options:

a. Click the Power Off button to immediately shutdown the system.

b. Click the Cancel button to stop the shutdown process.

c. Click the Restart button to restart the system instead of shutting down.

If you do not click any option, the system will automatically shutdown after 1 minute.


ii. Via the Power Off Utility:

Hit the super key on your keyboard which will open the search bar. 

Type poweroff in the search bar and press Enter

When the search result appears, click the Power Off utility.

You will see the below prompt informing you that your system is going to shutdown in 1 minute. 

In the meanwhile, you have the following options:

a. Click the Power Off button to immediately shutdown the system.

b. Click the Cancel button to stop the shutdown process.

c. Click the Restart button to restart the system instead of shutting down.

If you do not click any option, the system will automatically shut down after 1 minute.


[Need urgent assistance to configure Firewall on Ubuntu Linux? We are available to help you. ]


Conclusion

This article will guide you on different ways to shut down CentOS system. Using either of the above-discussed command line or GUI way, you can easily shutdown your #CentOS system.

To shut down the system from a terminal session, sign in or "su" to the "root" account. Then type ``/sbin/shutdown -r now''. 

It may take several moments for all processes to be terminated, and then Linux will shut down.

In #Unix and #Linux, the shutdown command can be used to turn off or reboot a computer. Only the superuser can shut the system down. 

One commonly issued form of this command is shutdown -h now , which will shut down a system immediately. 

Another one is shutdown -r now to reboot.