Team shutdown Linux

Anonim

Team shutdown Linux

Sequence of automatic actions when you turn off Linux

Before the start of the demonstration of the available commands, I would like to dively dwell on the sequence of automatically performed actions that run after the activation of the corresponding utilities. This will allow you to learn more about the principles of shutdown, and also come in handy in cases where specific options will be used for this.
  1. The completion of all user processes begins. For example, a text editor or browser is turned off.
  2. SIGTERM signal is provided with absolutely all active processes. In more detail about such signals, we suggest reading the article on the reference below.
  3. Now you know the sequence of all automatic actions that run with the standard disconnection of the computer.

    Method 1: Shutdown

    The Shutdown team known to many has become the first of those we want to tell in today's material. Additional options are applicable to this utility, so let's go on them first:

  • -H, -halt - power off without prior completion of all processes;
  • -P, -powerOff - standard system shutdown;
  • -R, -Reboot - sending a system for reboot;
  • -K - does not perform any actions, but only displays a message on the shutdown;
  • -No-Wall - shutdown without outputting the corresponding message;
  • -c - Cancel the scheduled shutdown.

Now let's look at a few simple methods of using Shutdown using additional options.

  1. Launch the "Terminal" convenient for you, for example, through the corresponding icon in the "Appendix" section or by pressing the hot key Ctrl + Alt + T.
  2. Go to the console to use Linux trip commands

  3. In the appeared string, enter the sudo shutdown -h now to turn off the computer immediately.
  4. Using the shutdown command in Linux to instantly disconnect the computer

  5. This action is carried out on behalf of the superuser, so you will have to confirm its input of the password. After that, the PC will immediately be disconnected.
  6. Enter the password to instantly disconnect the computer via the Shutdown command in Linux

  7. If you want to postpone shutdown, for example, for five minutes, you will have to change the string on Sudo Shutdown -h +5, where +5 is just the specified time through which the operating system will complete its work.
  8. Setting the timer to disable the computer via the Shutdown command in Linux

  9. When entering the Sudo Shutdown -C command, the scheduled shutdown will be canceled.
  10. Cancel computer disable via Shutdown command in Linux

  11. Use sudo shutdown -h 21:00 to set an accurate time of shutdown by changing the time you need.
  12. Turning off the computer via Shutdown command in Linux at the specified time

As you can see, nothing complicated in the application of the Shutdown command. You only have to learn the syntax and understand which situations to use this utility. If it turned out to be inappropriate, proceed to the study of the following ways.

Method 2: Reboot

If you pay attention to the Linux reboot article specified by the link above the console, you will see that the Reboot command allows you to cope with this task. For it, additional arguments apply to simply disable the system. Then the input row should find the type of sudo reboot -p. Enter it and activate to immediately complete the current session.

Using the reboot command to turn off the computer on Linux

Method 3: PowerOff

The last team, about which we want to talk within the framework of today's material, is called PowerOff. Actually, its name already speaks for itself, and in the console you only need to enter the same word so that the computer immediately turned off. There are no additional options to apply any additional options, but there are no other features of the utility, therefore, on this and finish familiarizing with it.

Using the PowerOff command to turn off the computer on Linux

Method 4: SYSRQ subsystem

If you are familiar with the location of the keys on the keyboard, you know that there is a switch with the name "sysrq" (its name is not written on all keyboards, but it is always on the Print Screen key). In Linux operating systems, there is the same subsystem that operates at the kernel level. If you are clinging the appropriate key combination, the system will complete its work. This combination looks like this: alt + sysrq + o. We decided to tell about this version at the end of today's article, because sometimes it is not possible to enter even the console commands to turn off the computer.

Using the SYSRQ subsystem to disconnect the computer on Linux

Today you have been familiar with four different ways to restart Linux, which are alternatives to the virtual button located in the graphical interface. It remains only to choose the optimal method to use it at the right moment.

Read more