Linux系统管理相关命令(关机、重启)

系统管理类命令

halt,poweroff,reboot、shutdown, init 0

1、halt:关闭操作系统

2、poweroff:关闭操作系统并关闭电源

3、reboot:重启操作系统

halt、poweroff、reboot三个命令,命令选项一样,如下所示:

--halt

Halt the machine 关机

-p --poweroff

Switch off the machine 关机并切断电源

--reboo

Reboot the machine 重启系统

-f --force

Force immediate halt/power-off/reboot 强制关机、切断电源、重启

-w --wtmp-only

Don't halt/power-off/reboot, just write wtmp record不实际关机、切断电源、重启,仅记录操作日志/var/log/wtmp

-d --no-wtmp

Don't write wtmp record 不记录日志

--no-wall

Don't send wall message before halt/power-off/reboot 在执行命令之前不发送 wall 消息,意味着此刻登录到系统中的用户不会看到系统将会重启的信息。

4、shutdown:关机

        shutdown [OPTION] ...TIME [MESSAGE]

        TIME:now, +m, HH:mm

-H --halt

Halt the machine 关机

-P --poweroff

Power-off the machine 关机并切断电源

-r --reboot

Reboot the machine 重启

-h

Equivalent to --poweroff, overridden by --halt 等同于-P

-k

Don't halt/power-off/reboot, just send warnings 不实际关机、切断电源、重启,只是发送警告

--no-wall

Don't send wall message before halt/power-off/reboot 关机前不发送消息

-c

Cancel a pending shutdown 取消挂起的关机命令

举例:

命令

说明

shutdown -h 12:00

系统将在12时准时关机。

shutdown -h now

立刻关机。

shutdown -r now

立刻重启系统。

shutdown -h +10

系统将在10分钟后关机。

5、init 0 关机、init 6 重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值