一、關機、重啓、註銷命令
關機:
- 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