I am using ubuntu server 14.04, Now downloading in process and i am leaving office. I want to shut it down after 2 hours. please help me, how to do it.
This didn't work for me.
sudo shutdown -P 60
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The time string may either be in the format "hh:mm" for hour/minutes specifying the time to execute the shutdown at, specified in 24h clock format. Alternatively it may be in the syntax "+m" referring to the specified number of minutes m from now. "now" is an alias for "+0", i.e. for triggering an immediate shutdown. If no time argument is specified, "+1" is implied.
So it seems you're missing a
+ (and presumably you mean 120)
You can use corn job to shutdown. The time and minutes you want to shutdown can be specified as below.
30 21 * * * root shutdown -h now
Above entry will run shutdown command at 21:30.
MM HH DD OO WW command MM: Minute, 0-59 HH: 24-hour hour DD: Day of month OO: Month WW: Day of Week (Sunday is 0, Monday is 1) command: Self-explanatory