CentOS随笔——关机命令

  关机重启命令

  在linux领域内大多用在服务器上,很少遇到关机的操作、毕竟服务器上跑一个服务是永无止境的,除非特殊情况面,不得已才会关机、

  正确的关机流程为:sync>shutdown>reboot>halt

  

   1.基本语法

    (1)sync    将数据由内存同步到硬盘中

    (2)halt     关闭系统,等同与shutdown -h now 和 poweroff

    (3)reboot   就是重启,等同于shutdown -r now

    (4)shutdown [选项] 时间

选项 功能
-h -h=haltguanji
-r -r=reboot重启

    

参数 功能
now 立即关机
时间 等待多久后关机

  

  2.常用命令

    (1)将数据由内存同步到硬盘中

      sync

    (2)重启

      reboot

    (3)关机

      halt

    (4)计算机将在1分钟后关机,并且会显示在登录用户的当前屏幕中

      shutdown -h 1 “this server will shutdown after 1 minute”

    (5)立马关机(等同于halt)

      shutdown -h now

    (6)系统立马重启(等同于reboot)

      shutdown -r now

猜你喜欢

转载自www.cnblogs.com/ahao-action/p/10770490.html