What is a Shutdown in Linux?
The shutdown command in Linux is used to shut down the system safely. You can shut down the machine immediately, or schedule a shutdown using 24 hour format. It brings the system down in a secure way. When the shutdown is initiated, all logged-in users and processes are notified that the system is going down, and no further logins are allowed. Only root user can execute shutdown command.
Syntax of shutdown Command
- The syntax of shutdown command:
shutdown [OPTIONS] [TIME] [MESSAGE]
Options of Shutdown
The following are the options of shutdown command in Linux:
-r : Requests that the system be rebooted after it has been brought down.
-h : Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.
-H : Requests that the system be halted after it has been brought down.
-P : Requests that the system be powered off after it has been brought down.
-c : Cancels a running shutdown. TIME is not specified with this option, the first argument is MESSAGE.
-k : Only send out the warning messages and disable logins, do not actually bring the system down.
shutdown command in Linux with Examples
The `shutdown` operation in Linux is a crucial command for managing system power states, allowing administrators to halt safely, power off, or reboot the system. This command provides flexibility in scheduling downtimes, ensuring minimal disruption to users and processes. In this article, we will explore the `shutdown` command with practical examples, illustrating how to use its various options to control system behavior effectively.
Table of Content
- What is a Shutdown in Linux?
- How to use shutdown?
- How to shutdown the system at a specified time?
- Linux Shutdown – FAQs