7

I would like to find a way to speed the shutting down process up by using shortcut keys.

I installed Ubuntu 14.10 - Utopic Unicorn on a Compaq HP, but I am not able to do that by following the methods used for the previous Ubuntu versions.

Is there a way to do that?

1
  • You can add: Shut Down;Reboot;Suspend;Hibernate;Log Out and Lock Screen functions to the dash via the following commands: sudo add-apt-repository ppa:atareao/atareao and: sudo apt-get update && sudo apt-get install power-commands Dec 23 '14 at 21:23
11

you can do

> sudo init 0

to shutdown your computer from the terminal or

sudo shutdown -r now 

to reboot it. Besides you can do man shutdown which will give you more detailed information about the shutdown command.

6
  • 2
    How do you open a terminal with the keyboard?
    – aebabis
    Dec 19 '14 at 16:53
  • 1
    usually Ctrl+Alt+T
    – wa4557
    Dec 19 '14 at 19:25
  • Ctrl+Alt+F1 also generally works, IIRC (it changes from showing the desktop environment to showing a virtual terminal)
    – cpast
    Dec 19 '14 at 19:58
  • @cpast Don't forget to mention that if you want to go back to the DE, use ctrl+alt+F7
    – Kroltan
    Dec 19 '14 at 23:31
  • 1
    @Kroltan If you're doing this to shut the computer down, that's not such an issue.
    – cpast
    Dec 19 '14 at 23:42
9

The quickest way to PROPERLY shut down any PC running Ubuntu Linux that I know of regards something that can only be properly described as a sort-of keyboard shortcut when using a laptop.

You merely TAP (do not hold down) the power button. This causes a shutdown dialogue to appear in which the highlighted option is SHUT DOWN, so if you then press the ENTER key the computer will begin the orderly shutdown process, and will typically shut down in under 5 seconds.

So from the top, TAP power button and press enter. It shuts down so fast your windows friends will assume you merely closed the lid.

5
  • in case you are wondering, this is how I turn off ALL my ubuntu computers. Even desktops. I tap the power button on the front. I'm in the process of building a high end desktop for my sister OUT OF WOOD. The design is a little abstract. I'm going to give it a remote power button which will reside near her keyboard but shrouded so that it cannot be pressed by accident.
    – gyropyge
    Dec 19 '14 at 10:49
  • I don't even see that shutdown dialog, probably because I've disabled it in dconf-editor, so it's definitely the quickest way available for me.
    – Sadi
    Dec 19 '14 at 11:07
  • wait... what? you DISABLED a shutdown dialogue? No doubt to make shutting down faster. I can understand why you might do that if you believed that going to the icon in the upper right corner was sufficiently annoying without having to press enter on a shutdown dialogue was too much additional work but really. I think the combination of tapping your power button and a disabled shutdown dialogue is going to bite you later. Please consider re-enabling that confirmation screen.
    – gyropyge
    Dec 19 '14 at 11:13
  • I can't think of a scenario where I would miss that dialog, as I have ctrl+alt+backspace to logout and the session menu item to restart.
    – Sadi
    Dec 19 '14 at 15:47
  • I don't know whether to be annoyed or amused that my answer got four upvotes but the chosen answer, not mine, received only two. I'm guessing this means that the one who asked the question was not satisfied with my solution but at least four people particularly liked it.
    – gyropyge
    Dec 19 '14 at 17:43
4
  • Hit the power button.
  • Use arrow key to go to "shutdown".
  • Hit Enter.

It works with all Ubuntu versions, and it is (to me) the quickest way to shutdown a machine.

2
  • 2
    Esc doesn't bring anything up for me in xubuntu 14.04
    – Mitch
    Dec 19 '14 at 14:32
  • Same here, a no-go in xfce. Why would Unity make a single ESC key the "shutdown" shortcut? Common to stop webpages from loading with esc key.
    – Xen2050
    Dec 19 '14 at 19:14
2

Set up a sudo shutdown -h now in tty ahead of time, press Enter, type in your password and don't press enter. When you want to shut down, Ctrl+Alt+F1 and Enter.

You can also restart in tty by Ctrl+Alt+Delete without a sudo, but then you need to shut down before it restarts.

1
  • Well played, well played...
    – Kroltan
    Dec 19 '14 at 23:34
1

You can also use the terminal Ctrl+Alt+T and type: sudo init 0

3
  • "Need to be root" for this command, which is not a very quick way ;-)
    – Sadi
    Dec 19 '14 at 10:40
  • sudo halt is an alternative with less keystrokes
    – Maerlyn
    Dec 19 '14 at 14:05
  • @Maerlyn ...not counting the password
    – Kroltan
    Dec 19 '14 at 23:33
1

Apart from the terminal and power button path, there is one more way using regular keyboard shortcuts.

  1. Press ctrl + f10 to take the focus to top bar.
  2. Now use the arrow key to move to power menu on the extreme right.
  3. Use arrow key again to select shutdown.
  4. Choose restart or shutdown again with arrow keys and Enter
2
0

I think the simplest way is to press Power button on your keyboard.

Just go to Power Option and set Power key to shutdown your pc.

0

If your GUI ubuntu desktop is not freezed, open a terminal by Ctrl+Alt+T shortcut and do the following:

To shutdown now :

sudo shutdown -P now

To restart now :

sudo shutdown -P -r now

To shutdown after (say) 20 minutes :

sudo shutdown -P 20  

Similarly, for restart also replace now by 20.

(To stop timed execution: Say after 15 minutes you decide not needed to shutdown/restart then go to the terminal window in which you executed the command and press Ctrl+C.)


If your GUI ubuntu desktop is freezed, go to commandline ubuntu desktop by Ctrl+Alt+F1(Here in place of F1, the keys F1to F6 are applicable ; also Ctrl+Alt+F7 will give you the GUI desktop back). Now in commandline ubuntu enter your login username and password. After successful login execute the same commands described above for shutdown (or restart).

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