00. 目录
01. 命令概述
poweroff命令用来关闭计算机操作系统并且切断系统电源。如果确认系统中已经没有用户存在且所有数据都已保存,需要立即关闭系统,可以使用poweroff命令。
02. 命令格式
格式:poweroff [选项]
- 1
03. 常用选项
-n 关闭操作系统时不执行sync操作
-w 不真正关闭操作系统,仅在日志文件“/var/log/wtmp”中
-d 关闭操作系统时,不将操作写入日志文件“/var/log/wtmp”中添加相应的记录
-f 强制关闭操作系统
-i 关闭操作系统之前关闭所有的网络接口
-h 关闭操作系统之前将系统中所有的硬件设置为备用模式
- 1
- 2
- 3
- 4
- 5
- 6
04. 参考示例
4.1 关闭计算机操作系统并且切断系统电源
[root@localhost ~]# poweroff
[root@localhost ~]#
- 1
- 2
4.2 关闭操作系统之前将系统中所有的硬件设置为备用模式
[root@localhost ~]# poweroff -h
[root@localhost ~]#
- 1
- 2
4.3 关闭操作系统之前关闭所有的网络接口
[root@localhost ~]# poweroff -i
[root@localhost ~]#
- 1
- 2
4.4 强制关闭操作系统
[root@localhost ~]# poweroff -f
[root@localhost ~]#
- 1
- 2
4.5 不真正关闭操作系统, 仅仅写入日志
[root@localhost ~]# poweroff -w
[root@localhost ~]#
- 1
- 2
4.6 关闭操作系统时不执行sync操作
[root@localhost ~]# poweroff -n
[root@localhost ~]#
- 1
- 2
评论记录:
回复评论: