Linux Shutdown and restart commands

Source: Internet
Author: User
Tags administrator password

 Linux Restart command:

  •   1,reboot

  •   2.shutdown-r now reboot (root user )

  • 3 shutdown-r Span lang= "ZH-CN" to 10 Minutes automatically restarts (Root user use )

  •   4.shutdown-r 20:35 Restart at time 20:35 (root user )

if you set the restart through the shutdown command, you can cancel the restart with the shutdown-c command .

 Linux shutdown command:

  •   1,Halt immediately shut down the machine

  •   2,Poweroff immediately shut down the machine

  •   3,shutdown-h now immediately shut down (root user use )

  •   4.shutdown-h Auto Power off after ten minutes

if you set the shutdown through the Shutdown command, you can cancel the reboot with the shutdown-c command!

 1.shutdown

    Shutdowncommand to safely shut down the system. Some users will use a direct power-down method to turn offLinux,this is very dangerous. BecauseLinuxwith theWindows, there are many processes running in the background, so forcing the shutdown maycan cause data loss to the process, leave the system in an unstable state, or even damage the hardware device in some systems. and before the system shuts down, useShutdowncommand, the system administrator notifies all logged-on users that the system will be closed. andLoginThe command is frozen, that is, the new user can no longer log on. Shut down directly or delay a certain amount of time before shutting down the machineis possible and may be restarted. This is by all processes (Process) will receive a signal that the system is serving (Signal)decision-making. This makes it look likeViSuch programs have time to store documents that are currently being edited, rather like processing messages (Mail) andNews (News) program can leave normally and so on.

    Shutdown performs its job of sending a signal (signal) to the init program, which requires it to change the runlevel.

    Runlevel 0be used to stop (Halt),RunLevel 6is used to reactivate (Reboot) system,andRunLevel 1is used to get the system into the state that the management work can take place; this is a preset, assuming there is no-HalsoNo-Rparameters toShutdown. To understand the downtime (Halt) or reboot (Reboot) What was done in the processaction that you can in this file/etc/inittabTo see this.Runlevelsrelevant information.

  Shutdown Parameter Description :

    [-T] Before changing to another RunLevel , tell init how long it will be shut down.

    [-R] Restart the calculator.

    [-K] do not really shut down, just send a warning signal to each login (login).

    [-h] power off after shutdown (halt).

    [-N] instead of init,, I shut down the machine. The use of this option is discouraged, and the consequences of this option are not always what you expect it to be.

    [-c] Cancel current process cancels the shutdown program that is currently executing. So this option certainly does not have a time parameter, but you can enter a message to interpret, and this information will be sent to each user.

    [-F] Ignore fsck when restarting the calculator (reboot).

    [-F] Forces fsck to restart the calculator (reboot) .

    [-time] setthe time before shutdown (shutdown).

  2.halt--the simplest shutdown command

In fact , Halt is called shutdown-h. when the halt executes, the application process is killed , the sync system is called, and the kernel is stopped after the file system write operation is complete.

parameter Description :

[-n] prevent sync system call, which is used with Fsck after patching the root partition to prevent the kernel from using the old version of the Super level block ( superblock) overwrite the patched super block.

      [-W] not really rebooting or shutting down, just writing wtmp(/var/log/wtmp) records.

      [-d] do not write wtmp record (included in option [-n] ).

      [-F] Forced shutdown or restart without calling shutdown .

      [-I.] before shutting down (or restarting), turn off all network interfaces.

      [-P] This option is the default option, which is to call Poweroff at shutdown.

  3.reboot

    Reboot works almost like halt, but it triggers a host reboot, and Halt is shut down. Its parameters are not much different from the halt.

  4.init

    Initis the ancestor of all processes, and its process number is always1,so sendTermSignal toInitwill terminate all theUser Process ﹑ daemon and so on. Shutdownis to use this mechanism. Initdefines the8operating level(RunLevel),Init 0to shut down the machine,Init 1restart. About theInitcan be lengthy, this is no longer described here. In addition, there areTelinitcommands can be changedInitlevel of operation, for example,Telinit-isAllows the system to enter single-user mode,and it's not going to work.Shutdowninformation and wait times.

  

How Linux modifies the root Administrator password

log in as root (SSH operation ), enter the passwd command to see the prompt to enter a new password, You cannot see the characters when you enter the password.

Linux Shutdown and restart commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.