Shut down

Synchronized video in this chapter: https://edu.51cto.com/sd/e4874

1.6 Shutdown
1.6.1 sync-flush file system buffers
sync [OPTION]
[root @ localhost ~] # sync
1.6.2 shutdown-Halt, power-off or reboot the machine
shutdown [OPTIONS ...] [TIME] [WALL. ..]
(1) Shut down immediately
[root @ localhost ~] # shutdown -h now
(2) Shut down after 10 minutes
[root @ localhost ~] # shutdown -h 10 'I will shutdown after 10 mins'
(3) 8pm : 25 Shutdown
[root @ localhost ~] # shutdown -h 20:25
(4) Restart immediately
[root @ localhost ~] # shutdown -r now
(5) Only send a shutdown message, but do not really shut down
[root @ localhost ~ ] # shutdown -k now 'This system will reboot'
(6) Undo the shutdown command that has been issued but not yet executed
[root @ localhost ~] # shutdown -c
1.6.3 halt, poweroff, reboot-Halt, power-off or reboot the machine
halt [OPTIONS ...]
poweroff [OPTIONS ...]
reboot [OPTIONS ...]
[root @ localhost ~] # halt
[root @ localhost ~] # reboot
[root @ localhost ~] # poweroff
1.6.4 systemctl
[root @ localhost ~] # systemctl poweroff
[root @ localhost ~] # systemctl halt
[root @ localhost ~] # systemctl reboot
1.6.5 init
[root @ localhost ~] # init 0 #Shutdown
[root @ localhost ~] # init 6
#Restart 1.6.6 Note
[calflyok @ localhost sbit] $ shutdown -h
Must be root. #Note
: 1. The shutdown command can only be done by root.
2. You can authorize other users to perform shutdown.

Guess you like

Origin blog.51cto.com/5482173/2486435