Linux关机、重启、注销命令

一、关机、重启、注销命令

关机:

  1. shutdown -h now #立即关机
  2. shutdown -h +1(shutdown -h 1) #1min后关机
  3. halt #立即停止系统,需人工切断电源
  4. poweroff #立即停止系统,且关闭电源
  5. halt -p (-p的含义:poweroff)
  6. init 0

重启:

  1. shutdown -r +1(shutdown -r 1) #1min后重启
  2. shutdown -r now #立刻重启
  3. reboot
  4. init 6

注销:

  1. logout
  2. exit
  3. ctrl+d

二、对于“注销”的深度理解

  1. logoutexit在“最小化安装版”中有效,在“桌面安装版”中无效。
  2. exit 退出控制台,对于多层shell,用于逐层退出,到最顶层shell,作用就和logout相同。
  3. 在“桌面安装版”可以使 logoutexit有效化的方法:
    在命令行里,用su -l xxx 切换到xxx用户,就是login shell了,就可以用logout,但是一般用exit就可以。
    使得shell为login shell
发布了5 篇原创文章 · 获赞 7 · 访问量 198

猜你喜欢

转载自blog.csdn.net/m0_46356860/article/details/104405177