Linux命令之shutdown

1.shutdown介绍

linux命令shutdown主要用来重启、关闭服务器。

2.shutdown用法

shutdown [参数]

shutdown常用参数
参数 说明
-c 取消即将执行的关机程序
-k

仅仅向每个登录用户发出警告信息,并不真正关机

-h 关机(halt)
-H 关机(halt)
-P 关机(poweroff)
-r 重启(reboot)
--help

shutdown帮助信息

3.实例

3.1.立即关机

命令:

shutdown -H now

OR

shutdown -h now

OR

shutdown -P now

OR

init 0

OR

poweroff

3.2.立即重启

命令:

shutdown -r now

OR

reboot

OR

init 6

3.3.30分钟后关机,并给出提示信息

命令:

shutdown -h +30 "The system will poweroff"

[root@rhel77 ~]# shutdown -h +30 "The system will poweroff"
Shutdown scheduled for Tue 2023-06-13 11:33:48 CST, use 'shutdown -c' to cancel.
[root@rhel77 ~]# 

使用shutdown -c可以取消上述动作

[root@rhel77 ~]# shutdown -h +30 "The system will poweroff"
Shutdown scheduled for Tue 2023-06-13 11:33:48 CST, use 'shutdown -c' to cancel.
[root@rhel77 ~]#
[root@rhel77 ~]# shutdown -cBroadcast message from root@rhel77 (Tue 2023-06-13 11:04:30 CST):The system shutdown has been cancelled at Tue 2023-06-13 11:05:30 CST![root@rhel77 ~]#

3.4.仅发出警告,系统不会关机

命令:

shutdown -k now "testing,haha"

[root@rhel77 ~]# shutdown -k now 'testing,haha'
[root@rhel77 ~]# 

3.5.查看shutdown帮助信息

命令:

shutdown --help

[root@rhel77 ~]# shutdown --help
shutdown [OPTIONS...] [TIME] [WALL...]Shut down the system.--help      Show this help-H --halt      Halt the machine-P --poweroff  Power-off the machine-r --reboot    Reboot the machine-h             Equivalent to --poweroff, overridden by --halt-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
[root@rhel77 ~]#

3.6.shutdown -h now、shutdown -H now、shutdown -P now的区别

1.shutdown -h now则根据系统的默认设置来选择是否关闭电源

2.shutdown -H now是关机操作,系统停止运行,但并未关闭电源   --可以vmware构建的虚机中运行此命令,进行观察,不建议使用此命令

[root@rhel77 ~]# shutdown -H now
Connection closing...Socket close.Connection closed by foreign host.Disconnected from remote host(192.168.10.137:22) at 11:13:49.Type `help' to learn how to use Xshell prompt.
[C:\~]$

虚机关机现象截图:

-->

-->

只能在VMware界面,进行"再次"关机动作

3.shutdown -P now是关闭电源操作

Linux命令(35)之shutdown相关推荐

  1. linux halt函数,常用Linux命令 reboot halt shutdown passwd vlock exit等

    1.重新启动和关闭系统: (1)reboot命令: reboot [选项] 选项含义如下: -d :重新启动后,系统不向/var/tmp/wtmp文件中写入记录 -f  :强制系统重新启动 -w :仅 ...

  2. Linux命令之关机shutdown

    概述 shutdown 命令可以用来关闭系统,并且在关机前发送信息给所有使用者,也可以用来重启系统. 语法 该命令的语法如下: shutdown [-t seconds] [-rkhncfF] tim ...

  3. linux命令hwclock,Linux命令之hwclock - 查询和设置硬件时钟

    常用参数 -r, --show         读取并打印硬件时钟(read hardware clock and print result ) -s, --hctosys      将硬件时钟同步到 ...

  4. linux下常用的关机命令有:shutdown、halt、poweroff、init;重启命令有:reboot。下面本文就主要介绍一些常用的关机命令以及各种关机命令之间的区别和具体用法。

    linux下常用的关机命令有:shutdown.halt.poweroff.init:重启命令有:reboot.下面本文就主要介绍一些常用的关机命令以及各种关机命令之间的区别和具体用法. 原创未通过审 ...

  5. linux64命令,每天一个Linux命令(64)shutdown命令

    shutdown以一种安全的方式关闭系统. (1)用法: 用法:  shutdown [参数] [时间] (2)功能: 功能:  系统关机命令,shutdown指令可以关闭所有程序,并依用户的需要,进 ...

  6. linux命令shutdown

    linux命令shutdown用关机用,一个命令就关机,省事 shutdown -h now 关闭系统 shutdown -h hours:minutes & 按预定时间关闭系统 shutdo ...

  7. linux命令fsck和fcsk,在ubuntu中shutdown和reboot的各参数的作用是什么? | 星尘

    shutdown参数 :   -t seconds : 设定在几秒钟之后进行关机程序   -k : 并不会真的关机,只是将警告讯息传送给所有只用者   -r : 关机后重新开机   -h : 关机后停 ...

  8. reboot重启linux能清理内存,Linux关机和重启shutdown、reboot命令

    Linux关机和重启shutdown.reboot命令 曾经有一个很有意思的段子,说一个程序员在自己的简历上写到:"熟练掌握 Linux 的开关机和重启",开机操作任何系统都不难, ...

  9. Linux关机和重启shutdown、reboot命令

    曾经有一个很有意思的段子,说一个程序员在自己的简历上写到:"熟练掌握 Linux 的开关机和重启",开机操作任何系统都不难,硬件肯定要给予一个开机的按钮,至于 Linux 的关机和 ...

最新文章

  1. python教程课后答案-python从入门到实践课后习题第八章
  2. Follow me!百万奖金由你拿 | 精准资助机器学习(三)
  3. Apache 服务器存在高危提权漏洞,请升级至最新版本 2.4.39
  4. mysql 查询设置调优_MySQl 查询性能优化相关
  5. 201101shell脚本
  6. GoLang之方法与接口
  7. 全球增长最快域名解析商Top10:中国占据四席
  8. 华为S1720, S2700, S5700, S6720 V200R010C00 产品文档
  9. 中国内地楼市泡沫严重 租售比1000倍超美国
  10. Socket发送缓冲区接收缓冲区快问快答
  11. PHP云尚发卡,搭建个人发卡平台教程:云尚发卡平台搭建
  12. Attention-guided Context Feature Pyramid Network for Object Detection
  13. 报错 Missing number, treated as zero. \begin{subfigure}{0.24\linewidth}?怎么解决
  14. python画正方形-用python画正方形
  15. 从应用迁移到平台微认证:鲲鹏技术解读
  16. 【收藏】众多iOS开源资源库
  17. 函数平移口诀_三角函数平移伸缩变换口诀是什么
  18. 计算机毕业优秀作品展观后感,毕业展观后感
  19. C51单片机之keil编程入门(一)
  20. 使用响应扩展的响应面(Rx)

热门文章

  1. Multi-Segment应用——VTEP位于TOR交换机上
  2. VS2022打开Device Explorer报错
  3. 怎么进行多人配音?建议收藏这些方法
  4. 中国新能源汽车产业链深度分析及投资前景规划报告2022-2027年
  5. ios转换html标签,iOS html标签解析解决方案
  6. Seurat 单细胞转录组测序数据分析教程(二)——python(scanpy)
  7. spring版本冲突报错解决:引入dubbo包,排除dubbo依赖的低版本spring
  8. jq循环赋值input
  9. MPB:山大倪金凤组-​黄翅大白蚁后肠几丁质降解微生物的分离与培养
  10. “汽车人”眼中的网络安全---关于AUTOSAR E2E及测试开发实践