Linux开关机命令——Centos7.7
可以使用man
进行询问,例如:
[root@smx ~]# man shutdown
[root@smx ~]# man init
1. 开机启图形化界面startx
2. 关机shutdown
、poweroff
、init 0
、halt
、
①shutdown:
安全地将系统关机。还有很多地参数可以去问一下man。
立刻关机(root用户使用)
[root@smx ~]#shutdown now
十分钟后自动关机
[root@smx ~]# shutdown 30
Shutdown scheduled for 一 2020-08-10 11:59:00 CST, use 'shutdown -c' to cancel.
取消自动关机
[root@smx ~]# shutdown -c
Broadcast message from root@smx.sbs (Mon 2020-08-10 11:30:19 CST):
The system shutdown has been cancelled at Mon 2020-08-10 11:31:19 CST!
②poweroff:
关闭机器。
③init 0:
init是所有进程的祖先,它的进程号始终为1。这里init 0 表示关机。
④halt:
halt就是调用shutdown -h。halt执行时,杀死应用进程,执行sync系统调用,文件系统写操作完成后就会停止内核。