shutdown ubuntu from terminal

In this tutorial which is targeted for Beginner Linux users, we are going to show you the command to shutdown Ubuntu From Terminal.

Shutdown Ubuntu From Terminal : Linux Command Guide

Shutdown Command Format

shutdown [-akrhPHfFnc] [-t sec] time [message]


-aControl access to the shutdown command.
-rReboot the system.
-kIt doesn’t perform the shutdown but send the warning messages as if the shutdown were real.
-hShut down and then halt.
-PIt instructs the system to power down after shutting down.
-cCancel a pending shutdown.
-fSystem won’t start fsck function after reboot.
-FForce fsck after reboot.
messageCustom message which can be used to aware the users regarding shutdown.

Command Example

To shutdown Ubuntu, you need to run the command:

$ sudo shutdown -h now

Note: “h” refers to halt which means to stop. “now” is a time parameter which means that system is going to shutdown right now.

In the command below, we will show you the command to set time parameter in minutes or hours also. Open your terminal and run the following command:

$ sudo shutdown -h +10 "System is shutting down in a while, Please save your work."

Restart Command

Interestingly, there is no separate command for restart as the shutdown command can be used to restart a system. There is trick here as you need  to use  r option instead of the h option.

Run the following command in your terminal to restart your system.

$ sudo shutdown -r +5 "System will restart in 10 minutes."

Cancel Shutdown Command Operation

At this point a shutdown can be canceled by calling shutdown with “c” option.

$ sudo shutdown -c



READ More Relevant Stuff:  Linux Command Cheat Sheet For 2023: Download For Free

Leave a Reply

Your email address will not be published. Required fields are marked *