automatic shutdown in ubuntu

You shouldn’t waste a lot of system resources by keeping the computer in ‘on mode’ even though you aren’t using it ( Save Energy! ), should you? ( I hope your answer will be NO, ‘ for the sake of Humanity ‘ ). In some cases Auto shutdown command may help you a lot because it will automatically shutdown your computer at specific time (and of course you can use that command to shutdown your computer immediately from the terminal) and you can cancel the command in the mid time (I mean – before the scheduled time) if you want.

I often use this command, later I thought it might help you in saving a lot of valuable computing resources and energy. Since it is some kind of command – so if you think that ‘I may have to mess with Terminal or Linux shell’ then you need to relax! it’s one of the most simple command and you can learn it in few seconds. It doesn’t matter whether you are using Ubuntu 11.04 (Natty Narwhal) or 10.10 (Maverick Meerkat) or 10.04 (Lucid Lynx) or any other Linux based systems such as Linux Mint.


Auto Shutdown Command in Ubuntu 11.04/10.10/10.04

Open Terminal(CTRL+ALT+T). To shutdown the computer at specific Time use (You may have to authenticate yourself by entering your ubuntu login password)  –

sudo shutdown -h HH:MM


sudo shudown -h 1:30

or if you want to shutdown now then just enter zero in place of time

sudo shutdown -h 0

The above method is used when you want to specify absolute time. On the other hand you can also specify relative value of time i.e 3 hours from now, using the following command –

sudo shutdown -h +3:00

That’s All..If you have any problem, then mention it in the comment.

  • Nagarjuna Rao Dustakar

    That’s Great. Worked Perfectly.

  • Mohsin

    It’s awesome. Thanks a lot.

    • Anonymous


  • Ederico

    Thanks, very helpful and much better than an application. However I have a problem. I try to execute a command which supposedly should shutdown my system after a minute, that means I use “sudo shutdown -h +0:01”. However, it doesn’t work. A shutdown command gets executed but the time left is not 1 minute. I only tried two times, the first time it was over a 1000 minutes. I executed just now to test it again and I got 701 minutes.

  • Me

    Thank you so much

  • monica

    one help.. i want to stop the shutdown process which i created ( ie running ).. if i created a new , it says that shutdown process is already running 

    • Ederico

      Monica, generally I do that using htop.

      I’m not sure, but I believe you can install it from the Ubuntu Software Centre. If not, I believe sudo apt-get install htop should do it.

      Once you have htop all you need to do is open a terminal and type htop to run it. Once you load htop press F3 for the search function, type “shutdown” and you should find the relative command. Then press F9 and choose SIGKILL from the menu on the left, press ENTER and that should do it. It does for me. :-)

  • Renzo Luttges C.

    Nice, but what if i want to shutdown ONLY if no user is logged in? for instance, i wont like autoshutdown interrupt mi favorite movie!!! 😀

  • Hendog

    how do you abort a shutdown?

    • ormis

      sudo shutdown -c

  • Apolo Mund

    thank you! very simple and useful!

  • Endy Hidayat

    hi,… I like your post. but how can I run auto shutdown and it never ask password to me,… how can I do that,..? tx!

  • yuvikumar

    its simple