This question already has an answer here:
- Shut down computer from keyboard 18 answers
What is the shortcut key to shutdown the computer for Ubuntu 12.04?
To shut down from a terminal you can use
There by default is no safe shutdown key combo in newer versions of ubuntu that I know of. In older versions of ubuntu using CTRL+ALT+DELETE will give you an option to shutdown though.
If you want to force a mostly-safe shutdown you can use REISUB.
Hold down ALT and SYSREQ. The SYSREQ key is the PRT SCRN (Print Screen) key on most systems. So hold down ALT and PRT SCRN, then press the following keys in order: R, E, I, S, U, B.
Be sure to wait at least 2 seconds after pressing one key before pressing the next! After you press B, the system should reboot.
For more info on ALT+SYSREQ combos check out: http://en.wikipedia.org/wiki/Magic_SysRq_key