This small tutorial shows two ways of shutting down or rebooting a Debian 10 server or desktop using the terminal. The same commands will work for Debian 11 too.
Using shutdown command
Open the terminal and execute the following command to shut down the machine,
shutdown --poweroff
This will shut down the machine. If you want to cancel, you have to use the -c switch along with the shutdown command.
Similarly, when you have to reboot, execute the below command. If you want to cancel your action, use –reboot option.
shutdown --reboot
Using systemctl command
An alternative to the shutdown command is to use the systemd systemctl command.
Debian 10 power off using systemctl:
systemctl poweroff
Debian 10 reboot using systemctl:
systemctl reboot