Linux shutdown命令使用实例

2023-11-22 0 835

shutdown是最安全的关机和重启命令,平时使用时推荐使用shutdown命令关机和重启,下面为大家讲解一下shutdown使用方法。

(1).常用选项

-c 取消已经在进行的shutdown指令内容

-h 关机

-k 发送警告信息给所有登录者

-r 重启

(2).unbuntu独有参数,CentOS没有参数

-f 重启后强制略过fsck磁盘检测

-F 重启后强制进行fsck磁盘检测

(3).实例

特定时间执行关机命令

shutdown –h now             //立即关机
shutdown –h 12:00           //在12:00关机

指定五分钟后关机,并发出警告信息

[root@CentOS6 桌面]#shutdown +5 “This System will be shutdown in 5 minutes”
Broadcast message from root@CentOS6.8
                  (/dev/pts/0) at 13:33 …

The system is going down for maintenance in 5 minutes!                 //系统提醒
This System will be shutdown in 5 minutes                                            //用户自定义提醒

指定3分钟后重启,并发出警告信息

[root@CentOS6 桌面]#shutdown –r +3 “3分钟后关机重启”
Broadcast message from root@CentOS6.8
                  (/dev/pts/0) at 13:53 …

The system is going down for reboot in 3 minutes!          //系统提醒
3分钟后关机重启                                              //用户自定义提醒

给所有登录用户发送提醒

[root@CentOS6 桌面]#shutdown –k “Waring:maybe the system will be shutdown”
Shutdown:time expected
Try’shutdown --help’ for more information.
[root@CentOS6 桌面]# shutdown –k 5 “Waring:maybe the system will be shutdown”
[root@CentOS6 桌面]#
Broadcast message from root@CentOS6.8
                  (/dev/pts/0) at 14:26 …

The system is going down for maintenance in 5 minutes!
Waring:maybe the system will be shutdown

本文来源:www.lxlinux.net/6630.html,若引用不当,请联系修改。

相关文章

猜你喜欢
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

  • 0 +

    访问总数

  • 0 +

    会员总数

  • 0 +

    文章总数

  • 0 +

    今日发布

  • 0 +

    本周发布

  • 4975 +

    运行天数

你的前景,远超我们想象