How to Use the Shutdown Command on Debian 12

Shutdown means to turn off the command by terminating all the running processes with a single click on different operating systems. It is recommended and suggested to shut down the computer when there is no usage of the computer. 

If the computer is shut down properly then it will provide the following things:

  • Enhances the performance efficiency of the computer
  • It extends the lifespan of the computer
  • It secures the computer from power surges
  • It saves the files from being corrupted which usually occurs when the computer is turned off forcefully 

After these advantages, it is recommended to shut down the computer properly. Debian is the Linux distribution that can be managed through the command line interface by executing the commands. 

Shutdown is the Linux command utility that is used to shut down the computer on Debian. This command has many other options which are used for multiple purposes which are explained in this post. 

The outline of the article will be:

What is the Shutdown Command on Debian Linux?

The shutdown command is used to manage the tasks related to shutdown such as to restart the computer and turn off the computer using the terminal. 

Different options of the shutdown command can be used for different applications by following the next-mentioned general syntax:

$ shutdown [options] [time] [message]

The explanation of the above general syntax of using the shutdown command is that simply use the shutdown command with its different options according to your requirements. Set the time at which the shutdown command is supposed to implement that task. And lastly, type the message which you want to display on the computer screen before shutting down the computer. 

To find out the options and other information related to the shutdown command, open its manual with the following command:

$ man shutdown

To understand the usage of the shutdown command, different examples are demonstrated in the next section. 

Example 1: Turn Off the Computer Using the shutdown Command

The default action for shutting down the computer is by running the shutdown command either without an option or with the “p” option:

$ sudo shutdown
$ sudo shutdown -p

Example 2: Turn Off the Computer Instantly Using the shutdown Command

To turn off the computer immediately using the shutdown command, either use its “now” option or the “0” time as shown below:

$ sudo shutdown 0
$ sudo shutdown now

Example 3: Turn Off the Computer at Scheduled Time 

To turn off the computer after some specific time, set the time. The time format which is used by the shutdown command is hours: minutes. 

For example, if the computer is supposed to shut after three minutes, then run the command:

$ sudo shutdown +3

Similarly, to shut down at 03 pm, run the command:

$ sudo shutdown 15:00

Example 4: Abort the Scheduled Shutdown 

To cancel the scheduled time of shut down the computer, use the “c” option of the shutdown command:

$ sudo shutdown -c

Example 5: Restart the Computer

To restart or reboot the computer, use the “r” option of the shutdown command:

$ shutdown -r

Example 6: Halt the Computer Using the shutdown Command

To halt the computer, run the shutdown command with the “h” option:

$ sudo shutdown -h

Example 7: Display the Message Using the shutdown Command

To display the message such as a warning message before shutting down or restarting the computer, specify the message with the command. 

For example, to display the message “Computer will be restarted” after five minutes, run the command:

$ sudo shutdown +5 "Computer will be restarted"

This is all about the usage of the shutdown command on Debian Bookworm. 

Conclusion

To use the shutdown command on Debian 12, run the command following the “$ shutdown [options] [time] [message]” general syntax. 

The shutdown command is used to turn off the computer safely as well as to restart the computer. The usage of the shutdown command has been explained with the help of the examples in this post.