how to shutdown raspberry pi code example
Example 1: how to shutdown raspbian command
#poweroff
sudo poweroff
#reboot
sudo reboot
Example 2: raspbian shutdown command
sudo poweroff
Example 3: raspi emergency shutwodn
sudo shutdown -now
If it doesn't work. Pull the plug (it could damage your SD card but desperate
times call for desperate measures)