Debian

Tutorial of “shutdown” command on Debian 11 System

When you shut down your computer, all of your software, files, programs, and processes are closed, and all data in RAM memory is removed. If you are not using your system, it is best to turn it off to save energy. Sometimes to update packages or upgrade systems we also need to shut down our system and then start it.

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:

$ shutdown [options] [time] [message]

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:

$ sudo shutdown

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:

$ sudo shutdown now

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:

$ sudo shutdown [time]

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:

$ sudo shutdown 11:50

Output shows that System will shut down at 11:50:00

To shut down System after 5 minutes run the below mentioned command:

$ sudo shutdown +5

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:

$ sudo shutdown +2 “System update”

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:

$ sudo shutdown -r

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:

$ sudo shutdown +3 –r “Update System”

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:

$ sudo shutdown -c

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.

About the author

Alishba Iftikhar

I am currently an undergraduate student in my 1st year. I am an internee author with Linuxhint and loved learning the art of technical content writing from senior authors. I am looking forward to opting my career as a full time Linux writer after I graduate.