shutdown (halt or reboot the system)

This command is used to power down or reboot the system. Here is an example of its most common use:

sudo shutdown -h now

This will shut down the system immediately. Only root is allowed to call shutdown. Instead of the keyword now, you can use a time specification in the form hh:mm or +m to schedule shutdown at a later time. For example, specifying +10 will shut down the system in ten minutes. Use the option -r instead of -h to reboot the system. The following command will reboot the system in ten minutes:

sudo shutdown -r +10

You shouldn't use shutdown when you're logged into a graphical desktop environment, because you might prevent the system from doing important clean-up work. Use the desktop's inbuilt shutdown facility instead. Still, the shutdown command may come in handy when things go wrong, e.g. when your desktop crashes.