ITPub博客

首页 > 数据库 > 数据库开发技术 > poweroff指令的介绍

poweroff指令的介绍

原创 数据库开发技术 作者:bisal 时间:2023-09-14 19:00:00 0 删除 编辑

Linux中poweroff指令用来关闭计算机操作系统并且切断系统电源。poweroff、reboot和halt可分别用于关机、重启或停止机器。这三个指令都有相同的选项。

poweroff的命令格式,

poweroff [OPTIONS...]

常用选项,

-d, --no-wtmp  关闭操作系统时,不将操作写入日志文件“/var/log/wtmp”。  -f, --force  强制关闭操作系统。  -n, --no-sync  关闭操作系统前不同步硬盘/存储介质。  -w, --wtmp-only  不真正关闭操作系统,仅在日志文件“/var/log/wtmp”中写入 wtmp 关闭条目。  -p, --poweroff  不管调用 poweroff、reboot 和 halt 中的哪一个,都要切断主机电源。  --help  显示帮助信息。  --halt  不管调用 poweroff, reboot 和 halt 中的哪一个,都要停止机器。  --no-wall  请勿在 poweroff, reboot 或 halt 前发送留言。

其中poweroff -p,相当于直接拔电源关机,可以用来模拟某些服务器hang的场景,可以通过man poweroff,了解参数含义,

-p, --poweroffPower-off the machine, regardless of which one of the three commands is invoked.

可能有朋友了解用过shutdown等指令,通过man,可以知道它的某些参数,就相当调用poweroff、halt、reboot,

--helpPrint a short help text and exit.
-H, --haltHalt the machine.
-P, --poweroffPower-off the machine (the default).
-r, --rebootReboot the machine.
-hEquivalent to --poweroff, unless --halt is specified.
-kDo not halt, power-off, reboot, just write wall message.
--no-wallDo not send wall message before halt, power-off, reboot.
-cCancel a pending shutdown. This may be used cancel the effect of an invocation of shutdown with a time argument that is not "+0" or "now".


如果您认为这篇文章有些帮助,还请不吝点下文章末尾的"点赞"和"在看",或者直接转发pyq,




近期更新的文章:
《MySQL 8.0新密码策略的细节场景讲解》
《几种数据泄露场景的排查解决路径》
《最近碰到的一些问题》
《金融知识小科普 - 量化交易》
《公众号1300篇文章分类和索引》

近期的热文:
《推荐一篇Oracle RAC Cache Fusion的经典论文》
《"红警"游戏开源代码带给我们的震撼》

文章分类和索引:
《公众号1300篇文章分类和索引》

原文作者:bisal的个人杂货铺;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论
Oracle ACE,10g/11g OCP,11g OCM,国内首批Oracle YEP成员(Oracle Young Expert Program,Oracle用户组年轻专家项目),EXIN DevOps Master,Oracle爱好者,微信公众号:bisal的个人杂货铺

注册时间:2022-06-21

  • 博文量
    539
  • 访问量
    2801252