This post was updated 589 days ago and some of the ideas may be out of date.

1、功能说明

shutwown:用于关闭服务器的系统,依照用户的需要,重新启动或关机。作用等同于poweroff命令

2、语法格式

shutdown [选项] [参数]

3、选项解释

-c:取消关机任务;
-f:重新启动时不执行fsck;
-F:重新启动时执行fsck;
-h:将系统关机;
-k:送出信息给所有用户,但不会实际关机;
-n:不调用init关机,而由shutdown自己进行;
-r:将系统重启;
-t:可指定关机的时间;或设置多久时间后运行。

4、参数解释

[时间]:设置多久时间后执行shutdown指令;
[警告信息]:要传送给所有登入用户的信息。

5、参考实例

# 立即关机
shutdown -h now 
# 10分钟之后关机
shutdown +10
# 12:30关机 格式 小时:分钟
shuitdown 12:30
# 指定10分钟后关机,同时送出警告信息给登入用户:
shutdown +5 "System will shutdown after 5 minutes"
# 服务器立即关闭并重启
shutdown -r now    
# 取消当前服务器上已有的关机任务:
shutdown -c

6

# 关机命令:
  shtdown -h now 立即关机
  halt     立即停止系统,需要人工关闭电源,是reboot的链接文件
  init 0   切换运行级别到0,0表示关机
  poweroff 立即停止系统,并关闭电源

# 重启命令
  reboot 立即重启
  shutdown -r now 立即重启
  init 6 切换运行级别到6,6表示重启

# 注销命令
  logout 注销退出当前用户窗口
  exit   注销推出当前用户窗口