|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 6

 
 
 
 
 
 
 
 
 

Walter 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

 

 

posted on   yanqi_vip  阅读(14)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示