首页>>帮助中心>>美国云服务器Linux关机命令用示例

美国云服务器Linux关机命令用示例

2025/3/4 7次

美国云服务器Linux关机命令
shutdown命令可让您关闭,暂停或重新启动系统。 以下是它的语法:

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

以下是手册页描述的方式:

shutdown may be used to halt, power-off or reboot the machine.

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.

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.

Note that to specify a wall message you must specify a time argument,
too.

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.
以下是一些Q&A样式的示例,应该给你关于关闭工具如何工作的好主意:

Q1。 如何使用关机?
基本用法很简单 - 您只需运行'shutdown'命令即可。

shutdown

此工具的默认行为是关闭机器。 请注意,如果没有指定时间参数,则隐含+1 ,这意味着关闭过程将在一分钟后开始。 如果您希望系统立即关闭,您可以使用现在或+0 。

如果您想要发出留言信息(要在发送之前发送给所有登录用户),可以通过以下方式进行:

shutdown 'YOUR MESSAGE HERE'

Q2。 如何停止使用关机的机器?
这可以使用-H选项来实现。

shutdown -H

如果你不知道,停止和关闭系统是有区别的。 前者涉及停止所有CPU,后者也确保主电源断开。

Q3。 如何使关机电源关机?
尽管这是默认情况下,您仍然可以使用-P选项明确指定要关机以关闭系统。

shutdown -P

Q4。 如何使用关机重新启动?
对于重新启动,选项是-r。

shutdown -r

Q5。 如何使关机只写壁挂消息,反之亦然?
如果您只想关机拍摄留言信息,而不执行暂停,关机或重新启动,请使用-k命令行选项。

shutdown -k

Q6。 如何取消挂起的关机?
您可以使用shutdown来安排暂停,关机或重新启动。 为此,你所要做的就是把你想要的过程开始。 例如:

shutdown -r 18:00

但是,如果您想要取消预定的关机,您也可以这样做。 这可以使用-c命令行选项完成。

shutdown -c

购买使用一诺网络美国服务器,可以极大降低初创企业、中小企业以及个人开发者等用户群体的整体IT使用成本,无需亲自搭建基础设施、简化了运维和管理的日常工作量,使用户能够更专注于自身的业务发展和创新。美国服务器低至49元/月,购买链接:https://www.enuoidc.com/vpszq.html?typeid=3

版权声明

    声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们996811936@qq.com进行处理。