8
1
Simple question: what params can be used to shutdown a computer running Linux/OSX in 30 seconds? I've always run Windows, where I would go shutdown -s -t 30
but the parameters are different. I've looked it up here but it will only let you shut a computer down at a specific time (like 8:00) rather than in a specific amount of seconds.
meh. So no using decimals.
I suppose that's alright, I was wondering because I'm trying to work on a cross-platform Java application that can shutdown a computer. So I could just make it sleep for 30 seconds before shutting down immediately.
But would
sudo shutdown -h
shutdown the computer without an intentional delay? – None – 2011-05-12T22:55:29.723@icnhzabot
sudo shutdown -h now
would shut the computer down immediately with no warning. – Austin – 2011-05-12T23:07:14.177ok thanks. so for root access I should do
sudo shutdown -h now
right? – icnhzabot – 2011-05-12T23:29:45.057@icnhzabot That won't work for an automated script/program because it prompts the user for their administrator password at the command line. You'd have to run your script as root and just call
shutdown -h now
. If you need help with that, you should make a new question (assuming you can't find the answer elsewhere). Also, don't forget to mark the best answer here as "accepted" if it answered your question. – Austin – 2011-05-12T23:43:56.130