As most people know only the GUI way to shutdown Systems but in this Article we will discuss how to shutdown Debian 11 (Linux OS) using the “shutdown” command in the terminal. The shutdown command can be used differently in different situations using “time” and “message” arguments.
Requirement
User should log in as root user
Below different ways are discussed to shut down System using “shutdown” command:
Shutdown Debian 11 Using “shutdown” command
The shutdown command shuts down the system in a secure manner. All users who are logged in and processes are told that the system is shutting down, and no additional logins are permitted.You can select to power off your computer right away or at some other time.
Syntax:
options: These are some shutdown options like power-off (the default option), reboot the system or halt.
time: The shutdown process is started at a specific time specified by the time argument.
message: The message option is used to specify a message that will be aired to all users.
Shut down system without specifying arguments of shutdown command
By running mentioned below command your System will be shutdown using shutdown command:
The system will shut down after 1 minute as the default time is 1 minute.
Now the system will shut down after 1 minute.
Shut down System Immediately using shutdown command
We can shut down our system immediately without waiting for default time of 1 minute using “now” after shutdown command by below mentioned command:
Shut down System after specified time using shutdown command
To shut down system after specified time, we use time argument with shutdown command so its syntax would become:
The time can have two formats; hh:mm set time according to timezone and +m will shut down System after specified minutes.
To shut down System at 11:50 run the below mentioned command:
Output shows that System will shut down at 11:50:00
To shut down System after 5 minutes run the below mentioned command:
Date command shows current time.
Shut down System by sending message using shutdown command
We can also send notification at the time of shutdown by using message argument after time in shutdown command. The mentioned message will be aired at the time of shutdown, run the below mentioned command to broadcast “System update” message with the help of shutdown command:
It will broadcast a message after shutdown command execution.
Reboot System using shutdown command
We can also reboot our system using using “-r” flag after shutdown command as mentioned below:
It will start reboot after default time of “1 minute”
Reboot system by specifying time and sending message using “shutdown” command
We can also fix the time for reboot as we do for shutdown. To reboot System after 3 min by airing “Update System” run the below mentioned command:
This will start reboot after 3 minutes and will display a message before rebooting.
Cancel shut down using “shutdown” command
If you want to cancel your shut down using “shutdown” command, run the below mentioned command:
Shortcuts using “shutdown” command
Options | Description |
---|---|
-a | To control access to the “shutdown” command, it employs the control access file “/etc/shutdown.allow.” |
-k | Instead of shutting down, deliver warning messages as though the shutdown is actual. |
-P | Tells the system to power down before shutting down. |
-f | It skips fsck after reboot. |
-F | After reboot it forces fsck. |
-H | This option orders the system to descend into the boot the monitor on computers which provide support to it if -h is also supplied. |
Conclusion
Every Operating System needs to be shut down after some time. Usually we shutdown the System using GUI but we can also perform this task using Command Line Interface. In the Command Line Interface the “shutdown” command is used to power off the System. In this article “shutdown” command tutorial is provided which explains several uses of “shutdown” command like shutdown after specified time, shutdown by airing message on screen, reboot system using “shutdown” command and how to cancel shut down using “shutdown” command. This write up will guide you to use the shutdown command efficiently.