Linux的shutdown

NAME#名称
shutdown – Halt, power off or reboot the machine
#shutdown – 停止、关闭或重新启动计算机

SYNOPSIS#概要

   shutdown [OPTIONS...] [TIME] [WALL...]

DESCRIPTION#描述
shutdown may be used to halt, power off, or reboot the machine.
#shutdown 可用于停止、关闭或重新启动计算机。

   The first argument may be a time string (which is usually "now"). Optionally, this may be followed by a wall message to be sent to all logged-in users before going down.
   #第一个参数可以是时间字符串(通常是 “now”)。(可选)此消息后跟一条 wall 消息,该消息将在关闭之前发送给所有登录用户。

   The time string may either be in the format "hh:mm" for hour/minutes specifying the time to execute the 
shutdown at, specified in 24h clock format. Alternatively it may be in the syntax "+m" referring to the specified number of minutes m from now.  "now" is an alias for "+0", i.e. for triggering an immediate
 shutdown. If no time argument is specified, "+1" is implied.
   #时间字符串可以采用 “hh:mm” 格式,表示小时/分钟,指定执行关机的时间,以 24 小时时钟格式指定。或者,它可能采用语法 “+m” 表示从现在开始的指定分钟数 m。 “now” 是 “+0” 的别名,即用于触发立即关闭。如果未指定 time 参数,则隐含 “+1”。

   Note that to specify a wall message you must specify a time argument, too.
   #请注意,要指定 wall 消息,还必须指定 time 参数。wall 消息会显示在屏幕上。

   If the time argument is used, 5 minutes before the system goes down the /run/nologin file is created to ensure that further logins shall not be allowed.
   #如果使用 time 参数,则在系统关闭前 5 分钟创建 /run/nologin 文件,以确保不允许进一步登录。

OPTIONS#选项
The following options are understood:
#了解以下选项:

       --help
           Print a short help text and exit.
           #打印简短的帮助文件

       -H, --halt
           Halt the machine.
           #停止机器。

       -P, --poweroff
           Power the machine off (the default).
           #关闭设备电源(默认)。

       -r, --reboot
           Reboot the machine.
           #重启。

       -h
           The same as --poweroff, but does not override the action to take if it is "halt". E.g.  shutdown --reboot
           #与 --poweroff 相同,但不会覆盖 “halt” 时要执行的操作。例如 shutdown --reboot
           -h means "poweroff", but shutdown --halt -h means "halt".
           #-h 表示 “关机”,但 shutdown --halt -h 表示 “停止”。

       -k
           Do not halt, power off, or reboot, but just write the wall message.
           #不要停止、关闭电源或重新启动,而只需编写 wall 消息。

       --no-wall
           Do not send wall message before halt, power off, or reboot.
           #请勿在停止、关闭电源或重新启动之前发送 wall 消息。

       -c
           Cancel a pending shutdown. This may be used to cancel the effect of an invocation of shutdown with a time argument that is not "+0" or "now".
           #取消待处理的关闭。这可用于取消使用非 “+0” 或 “now” 的 time 参数调用 shutdown 的效果。

       --show
           Show a pending shutdown action and time if there is any.
           #显示待处理的关闭操作和时间(如果有)。
           Added in version 250.
           #在版本 250 中添加。

EXIT STATUS#退出状态
On success, 0 is returned, a non-zero failure code otherwise.
#成功时,返回 0,否则返回非零失败代码。

COMPATIBILITY#兼容性
The shutdown command in previous init systems (including sysvinit) defaulted to single-user mode instead of powering off the machine. To change into single-user mode, use systemctl rescue instead.
#以前的 init 系统(包括 sysvinit)中的 shutdown 命令默认为单用户模式,而不是关闭计算机电源。要更改为单用户模式,请改用 systemctl rescue。

SEE ALSO#另见
systemd(1), systemctl(1), halt(8), wall(1)

systemd 255

评论

发表评论

了解 数据控|突破是我们的每一步 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读