关机和重启:
reboot,halt,poweroff 是 shutdown 的链接文件.
原理: 执行命令后, 到指定的时间之后发送请求给系统的 init 进程, 将系统进程调整到指定的运行级别, 并执行这个运行级别.
查看运行级别: runlevel
查看默认运行级别文件: /etc/inittab
- #1, 关机
- shutdown -h now
- shutdown -h +1
- shutdown -h 11:00
- halt
- poweroff
- init 0
- #2, 重启
- reboot
- shutdown -r now
- shutdown -r +1
- shutdown -r 11:00
- init 6
- #3, 注销用户
- logout
- exit
来源: http://www.bubuko.com/infodetail-2967112.html