Shutdown Linux System from the Command Line

How do I shutdown Linux System using the command line?

Linux has a variety of various tools which allow us to shut down/power off the system. shutdown commands can be run by only root user or a user listed in the wheel group. In this post, I will show you how to restart or shut down a Linux system using this command. The commands are available by default on any Linux system like Ubuntu, centos, fedora, RedHat or Debian and do not require the installation of any extra packages.

Shutdown Command Syntax

shutdown [OPTION] [TIME] [MESSAGE]

Shutdown Linux command

First, you need to log in as root user to shut down the system then, open the terminal and type any of the commands to shut down the system safely.

1.) Shutdown the system immediately:

[[email protected] ~]# shutdown -h now

2.) Reboot by using shutdown command:

[[email protected] ~]# shutdown -r now

3.) Shutdown the system after 5 minutes:

[[email protected] ~]# shutdown -h +5

shutdown 5 min

4.) Cancel a Shutdown

[[email protected] ~]# shutdown -c

cancel shutdown

-c option is used to cancel a scheduled shutdown

5.) Display user defined message while shutdown the system:

[[email protected] ~]# shutdown -h now 'System is going down for maintenance'

This command will broadcast a user-defined message ‘System is going down for maintenance’ before shutting down

6.) Schedule a shutdown:

[[email protected] ~]# shutdown -h 03:50

Above command will schedule a shutdown at 03:50
schedule shutdown

7.) Display a message without doing anything:

[[email protected] ~]# shutdown -k

This command only displays a message that the system will be power-off, but does not do anything.

8.) Power-off the system:

[[email protected] ~]# shutdown -P

This command will power off the system.
If you find this post helpful, please share it on your social networks. If you have any questions? Leave a comment below, or you can contact me using the contact us page.

Related Commands

systemctl poweroff
systemctl reboot

Add Comment