linux关机重启相关命令总结
shutdown
shutdown使用方法如下 : shutdown 后面跟上可选参数
[root@localhost ~]# 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
使用shutdown重启机器命令如下:
shutdown -r now //立刻重启
使用shutdown关机命令如下:
shutdown -h now //立刻关机
shutdown
poweroff
poweroff的使用说明如下: poweroff 后面 加上可选参数
[root@localhost ~]# poweroff --help
poweroff [OPTIONS...]Power off the system.--help Show this help--halt Halt the machine-p --poweroff Switch off the machine--reboot Reboot the machine-f --force Force immediate halt/power-off/reboot-w --wtmp-only Don't halt/power-off/reboot, just write wtmp record-d --no-wtmp Don't write wtmp record--no-wall Don't send wall message before halt/power-off/reboot
poweroff关机的命令如下:
poweroff //立刻关机
poweroff -p //立刻关机
poweroff重启的命令如下:
poweroff --reboot
init
切换运行级别
init帮助说明如下
[root@iZ2zegpluo0zzw2visuq29Z nmkj]# init --help
init [OPTIONS...] {COMMAND}Send control commands to the init daemon.--help Show this help--no-wall Don't send wall message before halt/power-off/rebootCommands:0 Power-off the machine6 Reboot the machine2, 3, 4, 5 Start runlevelX.target unit1, s, S Enter rescue modeq, Q Reload init daemon configurationu, U Reexecute init daemon
使用init重启命令如下:
init 6
使用init关机命令如下:
init 0
reboot
这个是平时重启最常用的命令,具体帮助手册如下
[root@iZ2zegpluo0zzw2visuq29Z nmkj]# reboot --help
reboot [OPTIONS...] [ARG]Reboot the system.--help Show this help--halt Halt the machine-p --poweroff Switch off the machine--reboot Reboot the machine-f --force Force immediate halt/power-off/reboot-w --wtmp-only Don't halt/power-off/reboot, just write wtmp record-d --no-wtmp Don't write wtmp record--no-wall Don't send wall message before halt/power-off/reboot
还有一些其他命令,待补充--------