Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I would like to shut down in a hurry. By hurry I mean 5 to 10 seconds. Assume I can run any script with root privileges in tty which I've prepared beforehand, and after 5 or 10 seconds the power will go out. What's the best way to minimize the damage (like maybe unmounting all devices, or closing all open files)?

share|improve this question

Anyway you can shutdown from terminal using the command,

sudo shutdown -h now


sudo poweroff

Afterwards you need to put your sudo password. Here is an answer describes how you can shutdown from terminal without entering password. To do so,

Just run sudo visudo from terminal and add the following line:

%user_name ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/shutdown

This allows you to run the above commands, using sudo, however with no password. So, sudo poweroff or sudo shutdown -h now will now result in a password less shutdown.

If you want a step further ahead you can make a alias named stopnow or whatever,

alias stopnow='sudo poweroff'

That would enable you to shutdown the system by only running stopnow in terminal.

share|improve this answer
sudo init 0 may be a faster command, but would skip the notifying users and wont stop applications that are running, which may be bad. – Paul Tanzini Dec 12 '13 at 15:05
This command won't do anything anyway without a time: shutdown: time expected And to shutdown you need the -h option. And this can sometimes take a long time which I don't always have. – ike Dec 12 '13 at 15:10
As in the linked answer: sudo poweroff should be quite fast and safe. I use it a lot when testing @#$% kernel boot parameters... – Rmano Dec 12 '13 at 16:46
@ike Yikes! On my laptop is more around 10 seconds. Have you tried the sudo init 0 suggestion? It is not clean but cleaner than the Magic SysRQ. See also – Rmano Dec 12 '13 at 17:15
No, it's not safe --- nothing short of the correct shutdown is safe. Maybe the OP should try to see why poweroff is so slow? – Rmano Dec 12 '13 at 17:32

Alt+Print Screen+R,E,I,S,U. Then Power Button to shut down.

Will quickly and safely shut down a computer running Linux (Ubuntu). It is talking directly to the kernel, and can be used at anytime.


This is a modified version of REISUB. Since we don't want a restart, B is replaced with just shutting the computer down.

share|improve this answer
This will restart, not poweroff. – i08in Dec 12 '13 at 14:43
ok, so I guess replace B with O then to shut down? I'm not going to try it because I don't need to, but the Wikipedia article says that will shut it down. – Paul Tanzini Dec 12 '13 at 14:46
This is in short "Reboot Even If System Utterly Broken". It is not going to shutdown the system. – souravc Dec 12 '13 at 14:52
I don't think this is minimizing the damage, on the contrary, this should only be used when the system is not responding. Killing processes is never good. And even when using this key combo we should wait a few secs between pressing those keys. (let the processes which can terminate safely before we SIGKILL them, wait for the sync before we unmount, etc.) – falconer Dec 12 '13 at 15:13
@Dash_plus_Java why don't you edit your answer, it is not actually an answer to the question. isn't it? – souravc Dec 12 '13 at 15:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.