一、关机、重启、注销命令
关机:
- shutdown -h now #立即关机
- shutdown -h +1(shutdown -h 1) #1min后关机
- halt #立即停止系统,需人工切断电源
- poweroff #立即停止系统,且关闭电源
- halt -p (-p的含义:poweroff)
- init 0
重启:
- shutdown -r +1(shutdown -r 1) #1min后重启
- shutdown -r now #立刻重启
- reboot
- init 6
注销:
- logout
- exit
- ctrl+d
二、对于“注销”的深度理解
logout
和exit
在“最小化安装版”中有效,在“桌面安装版”中无效。- exit 退出控制台,对于多层shell,用于逐层退出,到最顶层shell,作用就和logout相同。
- 在“桌面安装版”可以使
logout
和exit
有效化的方法:
在命令行里,用su -l xxx 切换到xxx用户,就是login shell了,就可以用logout,但是一般用exit就可以。
使得shell为login shell