|NO.Z.00015|——————————|^^ 操作 ^^|——|Linux&常用命令.V09|——|关机重启|
一、关机和重启命令:sync
### --- sync 数据同步
~~~     sync 命令的基本信息如下。
~~~     命令名称:sync。
~~~     英文原意:flush file system buffers。
~~~     所在路径:/bin/sync。
~~~     执行权限:所有用户。
~~~     功能描述:刷新文件系统缓冲区。### --- sync数据同步命令
[root@server11 ~]# sync二、shutdown 命令
### --- shutdown 命令
~~~     shutdown 命令的基本信息如下。
~~~     命令名称:shutdown。
~~~     英文原意:bring the system down。
~~~     所在路径:/sbin/shutdown。
~~~     执行权限:超级用户。
~~~     功能描述:关机和重启
~~~     命令的基本格式如下:### --- 选项:
~~~     -c:取消已经执行的 shutdown 命令
~~~     -h:关机
~~~     -r:重启
[root@localhost ~]# shutdown [选项] 时间 [警告信息]### --- shutdown既可以关机也可以重启
[root@server11 ~]# shutdown -r now                                      // 现在重启
[root@server11 ~]# shutdown -r 05:30                                    // 定义明天早上5:30重启
Shutdown scheduled for Fri 2021-03-05 05:30:00 CST, use 'shutdown -c' to cancel.### --- 取消重启
~~~     不建议重启,并不推荐重启和关机让计算机自己完成
~~~     是最安全的重启命令;推荐尽量使用shutdown命令
[root@server11 ~]# shutdown -c
Broadcast message from root@server11 (Thu 2021-03-04 21:31:35 CST):
The system shutdown has been cancelled at Thu 2021-03-04 21:32:35 CST!三、reboot命令
### --- reboot 命令
### --- 在现在的系统中,reboot 命令也是安全的,而且不需要加入过多的选项。
### --- 重启
[root@localhost ~]# reboot四、halt 和 poweroff 命令
### --- halt 和 poweroff 命令
### --- 这两个都是关机命令,直接执行即可。
### --- 这两个命令不会完整关闭和保存系统的服务,不建议使用。
### --- 关机  
[root@localhost ~]# halt### --- 关机 
### --- 不建议使用;不会对数据进行保存
[root@localhost ~]# poweroff五、init命令
### --- init 命令
### --- init 是修改 Linux 运行级别的命令,也可以用于关机和重启。
### --- 这个命令并不安全,不建议使用。
### --- 关机,也就是调用系统的 0 级别
[root@localhost ~]# init 0### --- 重启,也就是调用系统的 6 级别
[root@localhost ~]# init 6Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor
 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号