Schedule Shut Down or Reboot Using Terminal

Shutting down and rebooting the computer is mostly done using GUI, but some of functions can not be done easily from the GUI such as scheduling shut down and reboot. You might also be that type who hates performing tasks for the computer there by avoiding a lot clicking using the mouse. Using the keyboard only, sometimes shows how you make the computer does whatever you want by a single line of command.

Let’s take a look at how to reboot and shut down the computer from the terminal. In this tutorial I am using Ubuntu 13.04.

Launch the terminal, Ctrl + Alt + T. There are two methods to consider, doing it immediately and scheduling (doing it later). Performing this reboot or shut down the system immediately after the command is run:

Reboot syntax

$ sudo shutdown -r now

 reboot-now

Shut down syntax

$ sudo shutdown -h now

shutdown-now

Schedule : This tells the system to perform the reboot or shut down at a specified time. It is very useful if you want to perform a task when the system reboots in your absence.

sudo shutdown -r or -h time "customized message"

NB: time is in 24 hours format, -r for reboot and -h for shut downSchedule :

Reboot

sudo shutdown -r 00:30 "The system is rebooting to start printing"

schedule-reboot

  Sample Output:

Broadcast message from enock@enock-PC
(/dev/pts/4) at 0:13 …

The system is going down for reboot in 17 minutes!
The system is rebooting to start printing

reboot-msg

Shut down

sudo shutdown -h 01:30 "The system is shutting for cooling"

schedule-shutdown

Sample Output:

Broadcast message from enock@enock-PC
(/dev/pts/4) at 0:16 …

The system is going down for halt in 74 minutes!
The system is shutting for cooling

shutdown-msg

To cancel Press Ctrl + c.