Linux关机&重启&登录注销

1、关机&重启命令

  shutdown(若只输入shutdown,则等同于shutdown -h 1)

    shutdown -h now :立即关机

    shutdown -h 1:一分钟后关机

    shutdown -r now :立即重启

  halt:关机

  reboot:重启

  init 0:关机

  sync:把内存的数据写入磁盘中,建议在关机重启之前运行该命令

  【注意】

    1)不管是重启系统还是关闭系统,首先需要运行sync命令,把内存中的数据写到磁盘

    2)目前shutdown/reboot/halt等命令均在关机前运行了sync

2、登录注销

  1)尽量少用root账号登录,可以使用普通账号登录,登录后在使用【su - 用户名】命令来切换成系统管理员身份

  2)logout:注销,【注意:logout指令在图形运行级别无效,在运行级别3下有效】

posted @ 2019-08-19 14:04  酷学大叔  阅读(232)  评论(0编辑  收藏  举报