First things first, what these commands actually do:
- Both commands are a symbolic link to
systemctl
, the command line utility of systemd
.
- You can simply verify this by executing
ls -la /usr/sbin/shutdown
and ls -la /usr/sbin/reboot
- Thus, the commands are interpreted by
systemd
, which then decides the action to perform (among other tasks).
systemd
is the init system that Debian uses and simply put, responsible for starting and stopping services, including invoking a shutdown and reboot
- Shortly, both commands end up calling a specific
systemd
target, which in the end executes a system call. That's what defines what actually is happening.
Knowing this, both commands can lead to the very same targets and thus the very same kernel calls, doing the very same action. That fully depends on the command line options you use on these commands.
What does this mean for common cases?
- Simple reboots are accomplished with
shutdown -r
and reboot
. They lead to the same systemd target and therefore are doing exactly the same.
- Shutdowns are accomplished with
shutdown -h now
or shutdown -P now
. You cannot accomplish a shutdown with the reboot
command to my knowledge, as the --poweroff
switch is simply ignored when it is invoked through the reboot
command
So, should you avoid the reboot
command?
As shown both do their task. Depending on whether you want a shutdown or reboot, you use one of these commands with the appropriate options. There is no particular reason to specifically avoid the reboot
command, as, in case of rebooting it does the very same thing as shutdown -r
.
Source and more in depth description
You can read a more in-detailed description in "What is the difference between these commands for bringing down a Linux server?". It focuses on Red Hat Enterprise Linux, but as RHEL is using systemd just as Debian does, the explanations made there should be applicable to Debian as well.