Shutdown Command in Linux Terminal with Examples

Shutdown Command in Linux Terminal with Examples

In this article we are going to shows how to use shutdown command in Linux. If you want to learn about shutdown command in Linux with Examples then this post is ideal for you.

In the Linux, the shutdown command used to shutdown or reboots the system in a safe and secure way. When the shutdown process is initiated, all logged-in users and processes are notified that the system is going immediately or after a specified delay.


How to use shutdown Command in Linux

In the Linux, the basic syntax of the shutdown command is show as below:

shutdown [OPTIONS] [TIME] [MESSAGE]
  • options – Use Shutdown options like halt, power off or reboot.
  • time – Specifies that when the shutdown process perform.
  • message – It is specifies a message to all users before start shutdown process.

When you run the shutdown command without any option and argument, it will power off the machine.

sudo shutdown

The above command will shutdown the system within 1 minute which is default time interval.

How to shutdown System Immediately

If you want to shutdown your system immediately, run the command below:

sudo shutdown now

Shutdown the system at a Specified Time

Run the command below if you want to schedule the system to shutdown at 10 A.M:

sudo shutdown 10:00

OR

sudo shutdown 22:00

Below command will schedule the system to shutdown in 35 minutes from now:

sudo shutdown +35

Broadcast a Custom Message to Users

If you want to broadcast a custom message to all the users during the shutdown process, run the command below:

sudo shutdown +23 "System Upgrading"

Cancel a Scheduled Shutdown

Use  -c option, if you want cancel a pending shutdown:

sudo shutdown -c

You can also broadcast a message during cancel a pending shutdown:

sudo shutdown -c "Canceling shutdown"

Reboot System Using Shutdown Command

Use -r option with the shutdown command to reboot the system:

sudo shutdown -r

If you want to specify the time and a custom message with reboot process, run the command below:

sudo shutdown -r +25 "Reboot System"

The command below shutdown the system immediately, and automatically reboot it:

sudo shutdown -r now

For fore details of shutdown command, visit the shutdown man page.


That’s all

If you face any error and issue in above steps , please use comment box below to report.

If our tutorials helped you, please consider buying us a coffee. We appreciate your support!

Thank you for your support.

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top