shutdown raspberry pi from terminal code example
Example 1: turn of raspberry
# in raspberry shell type:
sudo shutdown now
Example 2: how to shutdown raspbian command
#poweroff
sudo poweroff
#reboot
sudo reboot
Example 3: raspbian shutdown command
sudo poweroff