shutdown in 30 seconds - not 30 minutes

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
nickc10
Level 1
Level 1
Posts: 4
Joined: Tue Oct 09, 2018 5:03 am

shutdown in 30 seconds - not 30 minutes

Post by nickc10 »

Hello

I am using Mint 18 with Mate desktop. I am trying to shutdown in 30 seconds from the command line using 'shutdown 30' however this is interpreted as minutes rather than seconds.

How do I specify seconds and not minutes?

thanks!
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: shutdown in 30 seconds - not 30 minutes

Post by gm10 »

You don't, but you could do something like this:

Code: Select all

sleep 30;shutdown now
srq2625
Level 4
Level 4
Posts: 420
Joined: Tue Jan 08, 2013 11:35 am
Location: State: Constant Confusion, Country: D'oh

Re: shutdown in 30 seconds - not 30 minutes

Post by srq2625 »

Check out this page for an overview of the shutdown command. Additionally, you could run the command man shutdown.
nickc10
Level 1
Level 1
Posts: 4
Joined: Tue Oct 09, 2018 5:03 am

Re: shutdown in 30 seconds - not 30 minutes

Post by nickc10 »

gm10 wrote:
Wed Oct 31, 2018 6:54 am
You don't, but you could do something like this:

Code: Select all

sleep 30;shutdown now
ah yes. that would work for me as it is the last element in a script I'm running

seems strange not to be able to specify seconds though ...?
nickc10
Level 1
Level 1
Posts: 4
Joined: Tue Oct 09, 2018 5:03 am

Re: shutdown in 30 seconds - not 30 minutes

Post by nickc10 »

srq2625 wrote:
Wed Oct 31, 2018 7:10 am
Check out this page for an overview of the shutdown command. Additionally, you could run the command man shutdown.
thanks. I have seen that page but using 'shutdown -t 30' results in a 30 minute scheduled shutdown

from the previous reply it seems seconds is not possible
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

Re: shutdown in 30 seconds - not 30 minutes

Post by gm10 »

nickc10 wrote:
Wed Oct 31, 2018 7:16 am
seems strange not to be able to specify seconds though ...?
Does it? Why do you need such granularity?

Anyway, it is the way it is. If you regularly need more granularity you can always create a wrapper script as /usr/local/bin/shutdown. It's the beauty of Linux, you can easily bend it to your will. :D
nickc10
Level 1
Level 1
Posts: 4
Joined: Tue Oct 09, 2018 5:03 am

Re: shutdown in 30 seconds - not 30 minutes

Post by nickc10 »

gm10 wrote:
Wed Oct 31, 2018 7:39 am
nickc10 wrote:
Wed Oct 31, 2018 7:16 am
seems strange not to be able to specify seconds though ...?
Does it? Why do you need such granularity?

Anyway, it is the way it is. If you regularly need more granularity you can always create a wrapper script as /usr/local/bin/shutdown. It's the beauty of Linux, you can easily bend it to your will. :D
OK no problem. Thanks again.
Post Reply

Return to “Newbie Questions”