How to use shutdown command with examples

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

Introduction

“Shutdown” refers to the process of stopping and shutting down a computer or server. This involves cutting the power to the main components of the system using a controlled process. Applications are closed, active processes and protocols are saved to the hard drive, device drivers are removed, and user settings are saved in the process.

There are several options to do so, including scheduling a shutdown at a specific time, shutting down immediately, broadcasting a unique message, and so on.

In this tutorial, We will show you how to use shutdown command in Linux

Syntax of shutdown command

shutdown (option) (time) (message)
  1. options define if you want to halt, power-off, or reboot the instance.
  2. time specifies time value when you want the shutdown to display.
  3. message adds a message that refers to the shutdown.
  • Using the shutdown command without additional arguments will executes the shutdown in 60 seconds.
  • Shut Down the System at a Specific Time
shutdown hh:mm
  1. hh refers to hours
  2. mm refers to minutes

For example:

shutdown 05:00

Use the command above to require a shutdown at 5 AM in the morning

  • To shut down the system in a specific number of minutes
shutdown +m

For example:

shutdown +40
  • To shut Down the System Immediately
shutdown now
  •  To add a message to the shutdown to notify the users what is happened.
shutdown (time) "message"

For example:

shutdown +40 "System maintenance"
  • To Cancel a Scheduled Shutdown
shutdown -c
  • Also to add a message to notify users that the shutdown is canceled
shutdown -c "Canceling System Shutting down"
  • To view all parameters with the info and description for each when shutting down the Linux system.
shutdown --help

Conclusion

That’s all,

In this tutorial, We showed you how to use shutdown command with the examples.

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook