The term shutdown defines the automatic shutdown and suspension of a computer or server. With it, the power supply to the central components of the system is interrupted in a controlled way: user programs are closed, active processes and protocols are saved to the hard disk, device drivers are removed, and device settings are saved. user. Linux operating systems can be shutdown, suspended, or rebooted using the shutdown command and its various options. Shutdown commands are entered in the Linux terminal , which is opened with the keyboard shortcut [Ctrl] + [Alt] + [T]. To return to the terminal window, press [Ctrl] + [D].
The shutdown command is used to shut down or restart Linux from the terminal. More options can be added, followed by a time specification and a message. The Linux shutdown command has this syntax:
shutdown [OPCIÓN] [TIEMPO] [MENSAJE]
For many of the commands mentioned here, there are one or more variants that have the same result..
shutdown -h
Linux shuts down in a minute. The -h option indicates a system shutdown or shutdown. Usually the same can be achieved by just giving the shutdown command.
shutdown
shutdown -r
Linux restarts in a minute. Option r means reboot , that is, reboot ..
shutdown -h 0
Linux shuts down immediately. The shutdown command is followed here by the h option and time 0 to indicate immediacy. Another much more common command for immediate Linux shutdown is the following:
shutdown now
shutdown -r 0
Thus, Linux reboots immediately. After the shutdown command, option r and time 0 are indicated to indicate that it should be performed immediately. This is another frequently used command for immediate Linux reboot:
shutdown -r now
The default Linux shutdown , which occurs after one minute, is especially useful for multi-user solutions , that is, when multiple users are simultaneously accessing a Linux computer or server. The network administrator has the option of setting up a notice in the form of a wall message to inform users that the system will be shutdown or reboot shortly. If Linux is used on a single computer , the commands Shut Down Linux Immediately or Restart Linux Immediately are also usually very simple.
The shutdown commands in Linux only work if you have administrator rights. On some Windows systems, this requirement can be circumvented by prefixing it with sudo : for example, in sudo shutdown now or sudo shutdown r 0.
On Linux systems you can also schedule shutdown or reboot for a specific point in time. To do this, enter the number of minutes or time after the Linux shutdown command as indicated in the following examples:
shutdown -h 20
Linux shuts down 20 minutes after entering the command. The following command is more common and has the same result:
shutdown +20
shutdown -r 20
Linux restarts 20 minutes after entering the command. You can add the plus sign to this command..
shutdown -r +20
shutdown -h 17:30
On Linux, times are indicated in a 24-hour format according to the hh: mm scheme . In this example, Linux shuts down at 5:30 p.m. In this case, you can also omit the h , which explicitly indicates that the system should be shut down or suspended:
shutdown 17:30
shutdown -r 17:30
Linux restarts at 5:30 p.m. In this case, the r option , which indicates reboot or reboot , cannot be removed, otherwise Linux would shut down without restarting.
In addition to the Linux shutdown commands listed, there are many other commands and options for suspending, shutting down, or restarting a Linux operating system. In general, they can also be combined with inputs to perform a timed Linux shutdown .
The terms suspend and shutdown refer to different processes. If a system is suspended, all processors (CPUs) are stopped; if it is turned off, the main power supply is also interrupted. In general, shutdown refers to suspending and shutting down a system.
shutdown -P
This command specifically directs the system to shut down and the main power supply to be disconnected.
shutdown 'ESCRIBIR AQUÍ EL MENSAJE DE PARED'
The wall message o wall message is the information that appears on the screen of the operating system users. Administrators can, for example, use the wall message to warn that the system is going to shut down.
shutdown -c
This command can cancel a pending shutdown or restart. For this to happen, the process must not have started yet.
The Linux terminal allows you to shut down, suspend, and restart the operating system with simple commands. In addition to the Linux shutdown commands , you can also install a graphical interface in the form of software, such as the qshutdown program , specially designed for the Ubuntu Linux distribution.
In the article Summary of the main Linux commands you will find all the necessary commands to control a Linux operating system from the terminal.