shutdown

最後更新: 2016-11-15

 

介紹



Windows

 

Location:

C:\Windows\System32\shutdown.exe

Opts

/r          # 將電腦關機並重新啟動

/s          # 將電腦關機

/t xxx    # Set the time-out period before shutdown to xxx seconds.

/p         Turn off the local computer with no time-out or warning.

/a         中止系統關機

 

Exampe: schedule reboot:

名稱 reboot system (one time)

程式: C:\Windows\System32\shutdown.exe

引數: /r /t 60

設定時間: "觸發程序"

 * 不論使用者登入與否均執行

 * 以最高權限執行 (bypass UAC(User Account Control)保護)

 

 



Linux

 

Usage:

shutdown [OPTION]...  TIME [MESSAGE]

shutdown  time [warning message]

shutdown -c    <--- Cancels a running shutdown.

Example:

shutdown 22:00 &      <-- 22:00 時 shutdown
shutdown +3 &           <--  3 min 後 shutdown
shutdown now            <-- 現在就 shutdown

If no time argument is specified, "+1" is implied.

其他選項:

  • -r                # reboot
  • -h               # either halted or powered off       // halt 與 poweroff 是有所不同!!
  • -H               # halted
  • -P               # powered off
  • -k               # Only  send  out the warning messages
  • -t time        # 預設值為 30

force reboot

reboot -f -n

-n    Don't sync before reboot or halt. Note that the kernel and storage drivers may still sync.

 


halt, poweroff, shutdown

 

halt

terminates all processes and shuts down the cpu.

poweroff

exactly like halt, but it also turns off the unit itself (lights and everything on a PC).

It sends an ACPI command to the board, then to the PSU, to cut the power.

shutdown

like poweroff, but it also runs the shutdown scripts.
 

 

Creative Commons license icon Creative Commons license icon