Pretty simple when you know how:

http://theos.in/howto/howto-shutdown-reboot-ubuntu-linux-command/