How to set shutdown time on ubuntu

The shutdown window of Ubuntu.Hi all,

So today I think I want to share a very simple tips on how to shutdown your Ubuntu system automatically using time as a trigger.

Alright, firstly, open up terminal (Yes, it is in your Application-Accessories menu). * In Ubuntu Natty you can just press [ALT+F2] and click on Run In Terminal and key in your password.

Now type this one line code, and press enter key. Key in your password if instructed to do so:

sudo shutdown -h +30

Okay, I'll explain what it do briefly.


This command is needed to run any root level task such as shutdown, install or remove programs.


This is the real command to shutdown your computer.


This is the option to the shutdown command above. The '-h' option make your computer shutdown or halt permanently. But, if you are only going to restart or reboot your computer, you can change the option to '-r'. e.g: sudo shutdown -r now


This is the time option to the command shutdown. '+30' means Ubuntu will be halt or shutdown permanently in 30 minutes. You can change it to +60, +10, +1 or +100 if you like. You can also use the 24 hour time format such as sudo shutdown -h 23:12 which means your computer will be shutdown at 11.12 p.m. And yes, you can restart or shutdown your machine immediately with the time option 'now'.

But if you like to cancel your shutdown order, just press CTRL+C on the terminal.