how to shutdown pc by terminal code example
Example 1: shutdown terminal command
#Shutdown
sudo shutdown -h now
#or
sudo shutdown -h [TIME]
#Reboot
sudo reboot
Example 2: restart terminal command line ubuntu
#To reset Terminal:
$ reset
#To rerun/restart your bash.rc
$ source ~/.bashrc
#To Restart your computer
$ reboot