Shutdown commands: Remember to use sudo before the command for Ubuntu. You will
need a console window open to issue commands. Alt-F2 allows you to open a
terminal easily. Just type terminal or konsole in the box. To kill a frozen
program type xkill in the box and then click on the frozen or misbehaving
window.
http://linux.die.net/man/8/shutdown
http://www.computerhope.com/issues/ch000606.htm
From the GUI: theos.in/news/ubuntu-linux-shutdown-the-x-server/
Ctrl+Alt+backspace kills X, as well.