3

I just installed Ubuntu 14.04 on my Intel NUC DN2820. And almost every night as I lie down to sleep I listen to music, and my NUC shuts down (On Windows). On Windows it has the easiest command ever in CMD: Shutdown -s -t 1000.

That doesn't work on Ubuntu I figured out, but I found this command: Sudo shutdown 18:45, for those who don't know, 18:45 is an example when the system will shut down.

I tried this in terminal: Sudo shutdown 01:00 and I got a message in terminal '' E:/ can`t find the command'' The E: drive is my external drive, and C: is my SSD, what can I do to get it to shut down?

Thanks :)

Swinzon
  • 143

2 Answers2

3

The correct command would be sudo shutdown -h 23:45 - without the -h or -r switch it isn't a valid command (there are others - see man page).

Using +9 instead of the time gives you any easy way to say 'in 9 minutes'.

Any reference to E:/ tells us that there is some reference to a windows command going on here as linux has no E:/ which is partly why there are comments as to what you really typed, above - please copy/paste commands, don't re-type them!

  • Thanks! :D I`ll try when I get home :) So I can use sudo shutdown -h +9? – Swinzon Jan 28 '15 at 09:51
  • yes - or any other time period (minutes) you fancy. now works as well. – Mark Williams Jan 28 '15 at 09:53
  • Okey, 'cus in Windows it's seconds. So correct me if wrong. I'll type this in terminal: sudo shutdown -h +20, than it'll shut down in 20 min? – Swinzon Jan 28 '15 at 10:06
  • @Swinzon yes, exactly. You can find out more about shutdown by running man shutdown. For seconds, use -t, for example sudo shutdown -h -t 60 will shutdown in one minute. It is the same as running sudo shutdown -h +1. – terdon Jan 28 '15 at 10:50
  • Oh, okay. I like to sleep to music :) Is there any command to get my machine to sleep? Or is it just shutdown? – Swinzon Jan 28 '15 at 12:39
  • there's sudo pm-suspend, if you like. You could set this up as sleep 39m ; sudo pm-suspend to zap it in a while... – Mark Williams Jan 28 '15 at 13:35
  • I didn't get it to work... – Swinzon Jan 29 '15 at 07:23
  • That's a shame, works on my ASUS eee... & desktop. What DID it do? – Mark Williams Jan 29 '15 at 07:35
  • Nothing, I typed "sudo shutdown -h +30" than it took about 2 min and it got to a new command line, I watched a movie, it was about 1.3h and nothing happened... – Swinzon Jan 29 '15 at 07:37
  • Most odd! something must have killed the running shutdown - it shouldn't just quit during the delay, obviously.. What happens with sudo shutdown -h now? Also might be worth checking /var/log/auth.log to check it did actually process the sudo. – Mark Williams Jan 29 '15 at 09:31
1

sudo shutdown -h +30 will let the system power off after 30 minutes.

Jens Erat
  • 5,051
  • 7
  • 31
  • 37
Svolder
  • 11
  • 2