Linux命令05:重启关机

简介:

Linux重启和关机是基本操作,必须掌握。所有操作必须是root或超级管理员权限。普通用户使用su -切换为root用户。

shutdown

最常用关机命令为shutdown
其用法如下。

1
# shutdown [option] time [message]

参数如下。
-r:reboot
-h:halted or powered off
-P:powered off
-c:cancels a running shutdown
-k:only send out warning messages and disable logins
举个栗子。

1
2
3
4
5
6
# shutdown -h now # 关机
# shutdown -h 09:15 # 09:15 关机
# shutdown -h 10 '10分钟之后关机' # 10分钟后关机并发送信息
# shutdown -k 20:00 '虚假关机信息' # 发送关机信息,但并不真正关机
# shutdown -c # 取消正在准备执行的关机指令
# shutdown -r now # 重启

reboot,halt,poweroff

reboot,重启。
halt,挂起。
poweroff,关机。
三个命令有一个共同的参数。
-f:强制,不去处理init相关操作。

init

init是到达某个启动级别,其中,级别0是关机,级别6是重启。
故关机重启也可以用如下命令。

1
2
# init 6 # 重新启动
# init 0 # 关机

~~ EOF ~~

目录
相关文章
|
2天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
191 85
|
7天前
|
设计模式 Java Linux
Linux的20个常用命令
Linux的23个常用命令
Linux的20个常用命令
|
6天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
|
4天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
|
3天前
|
机器学习/深度学习 存储 Linux
linux中强大且常用命令:find、xargs、grep
linux中强大且常用命令:find、xargs、grep
25 9
|
3天前
|
SQL 移动开发 Linux
linux下find、grep命令详解
linux下find、grep命令详解
37 8
|
5天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
|
2天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
|
3天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘
|
7天前
|
Linux
linux关机重启
linux关机重启 登录注销 shutdown -h now 立刻关机 shutdown -h 1 一分钟后重启 shutdown -r now 重启计算机 halt 关机 reboot 重启计算机 sync 内存数据同步到磁盘