“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)
- options define if you want to halt, power-off, or reboot the instance.
- time specifies time value when you want the shutdown to display.
- 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
- hh refers to hours
- mm refers to minutes
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
- To shut Down the System Immediately
- To add a message to the shutdown to notify the users what is happened.
shutdown (time) "message"
shutdown +40 "System maintenance"
- To Cancel a Scheduled Shutdown
- 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.
In this tutorial, We showed you how to use shutdown command with the examples.