你想要-P
,没有-p
。它区分大小写。还要意识到你必须是 root 才能像那样关机。
目前,有不同的进入方式。取自man shutdown
:
TIME may have different formats, the most common is simply the word
'now' which will bring the system down immediately. Other valid for?
mats are +m, where m is the number of minutes to wait until shutting
down and hh:mm which specifies the time on the 24hr clock.
Run Code Online (Sandbox Code Playgroud)
例子:
$ sudo shutdown -P 20:30
[sudo] password for ward:
Broadcast message from ward@sekhmet
(/dev/pts/0) at 20:14 ...
The system is going down for power off in 16 minutes!
Run Code Online (Sandbox Code Playgroud)