在Debian 11上,有的命令和CentOS并不相同。比如关机或重启。
如果在Debian 11直接输入poweroff或者reboot,会得到command not found的结果:
root@test:~# reboot
bash: reboot: command not found
root@test:~# poweroff --reboot
bash: poweroff: command not found
正确的方法是使用systemctl进行关机或重启:
关机命令:
systemctl poweroff
重启命令:
systemctl reboot
还有一种方法是使用全路径调用shutdown,以下是立刻重启命令:
/sbin/shutdown --reboot 0
本页永久链接:https://www.orztip.com/?p=707&article_title=debian-11-poweroff-reboot-command-not-found