关机

$ halt
$ poweroff
$ init 0
# 原则上服务器不允许关机,只能重启

重启

$ reboot
$ init 6
# 服务器重启前应关闭服务并保存

shutdown

# 推荐使用shutdown命令,安全稳定
$ shutdown [选项]
            -H      # 停止机器
            -P      # 关闭电源
            -h      # 相当于--poweroff,被--halt覆盖
            -r      # 重启
            -k      # 不关机/重启,只发送警告信息
            -c      # 取消计划

$ shutdown 20:28    # 晚上20:28关机
$ shutdown +10      # 10分钟后关机
$ shutdown -r now   # 立即重启
$ shutdown -h now   # 立即关机
$ shutdown -c       # 取消关机计划

登出

$ logout            # 退出当前用户登录
# 快捷键:Ctrl+D

操作结束离开时一定要注销你的登录!