Sometimes your Ubuntu system freezes due to some heavy load on your system or some poorly written applications. If your Ubuntu system freezes completely and you can’t use any of your mouse and keys, then you use the below method to reboot your Ubuntu PC or laptop without forcefully switch off your electric power button or removing your laptop battery or power plug.
Press and hold Alt and PrintScreen SysRq keyboard key buttons together and then type REISUB.
Hold
Alt+PrintScreenSysRq
then type
REISUB
This will reboot your computer.
[OR]
You can also use the below method to reboot or kill the process.
Press
Alt+Ctrl+F1
and login with your Ubuntu username and password. type the below command and hit enter.
sudo reboot
If you want to kill the high CPU usage process, follow the below steps.
Run the below command.
ps -ef
It will show all running processes. Note down the high CPU usage process id and then run the below command.
sudo kill <pid>
here <pid> is your process id.