shutdown
Linux shutdown命令可以用来进行关机程序,并且在关机以前传送讯息给所有使用者正在执行的程序,shutdown 也可以用来重开机。
使用权限:系统管理者。
[root@kvm ~]#
[root@kvm ~]# shutdown --help
shutdown [OPTIONS...] [TIME] [WALL...]
Shut down the system.
--help Show this help
-H --halt Halt the machine
-P --poweroff Power-off the machine
-r --reboot Reboot the machine
-h Equivalent to --poweroff, overridden by --halt
-k Don't halt/power-off/reboot, just send warnings
--no-wall Don't send wall message before halt/power-off/reboot
-c Cancel a pending shutdown
[root@kvm ~]#
halt
若系统的 runlevel 为 0 或 6 ,则Linux halt命令关闭系统,否则以 shutdown 指令(加上 -h 参数)来取代。
使用权限:系统管理者。
[root@kvm ~]# halt --help
halt [OPTIONS...]
Halt the system.
--help Show this help
--halt Halt the machine
-p --powero