Timer to shutdown
Solution 1
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!
Solution 2
sudo shutdown -h +30
will let the system power off after 30 minutes.
Related videos on Youtube
Swinzon
Updated on September 18, 2022Comments
-
Swinzon about 1 year
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 :)
-
αғsнιη almost 9 yearsyou have two typo: 1) change
Shutdown
toshutdown
and 2) changeSudo
tosudo
. note uppercase s -
Swinzon almost 9 yearsCan you give me the exact command? :))
-
-
Swinzon almost 9 yearsThanks! :D I`ll try when I get home :) So I can use sudo shutdown -h +9?
-
Mark Williams almost 9 yearsyes - or any other time period (minutes) you fancy.
now
works as well. -
terdon almost 9 years@Swinzon yes, exactly. You can find out more about
shutdown
by runningman shutdown
. For seconds, use-t
, for examplesudo shutdown -h -t 60
will shutdown in one minute. It is the same as runningsudo shutdown -h +1
. -
Mark Williams almost 9 yearsthere's
sudo pm-suspend
, if you like. You could set this up assleep 39m ; sudo pm-suspend
to zap it in a while... -
Swinzon almost 9 yearsI didn't get it to work...
-
Mark Williams almost 9 yearsThat's a shame, works on my ASUS eee... & desktop. What DID it do?
-
Mark Williams almost 9 yearsMost 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 thesudo
.